Page 1 of 1

how to get increment from automatic axis?

Posted: Fri Apr 29, 2005 1:36 am
by 9341112
How do i find what increment is used by an automatic axis? I need to set axisvaluesformat based on what increment was chosen.

eg I have 6 line series on the chart. I have values ranging from -0.3 to +0.9 and the axis shows a 0.05 increment. I need to set the format to #,##0.00 instead of the default.

klint.

Posted: Fri Apr 29, 2005 7:39 am
by narcis
Hi klint,

You just can get an axis increment using, for example, Chart1.LeftAxis.Increment. The axis increment can also be configured using the chart editor.

However you can also set it's value format using the chart editor at the Chart\Axis\Labels\Format tab or programmatically using:

Code: Select all

Series1.ValueFormat:='#,##0.00';

Posted: Wed May 04, 2005 1:31 am
by 9341112
Does that actually work?

If i put a chart (height 369, width 705), a button and a label on a form and the button click event is

procedure TForm1.BitBtn1Click(Sender: TObject);
var
l:tlineseries;
begin
l := tlineseries.Create(chart1);
chart1.addseries(l);
l.Add(0.1,'1');
l.Add(0.01,'2');
l.Add(0.2,'3');
l.Add(-0.2,'4');
chart1.leftaxis.Automatic := true;
chart1.leftaxis.minortickcount := 0;
chart1.leftaxis.Grid.Color := clLtGray;
chart1.refresh;
label1.caption := floattostr(chart1.leftaxis.increment);
end;

The label caption is 0 although the chart displays an increment of 0.05

klint.

Posted: Thu May 05, 2005 1:41 pm
by 9337233
I have this same problem. It seems that if the axis has automatic scaling, then the axis increment is undefined. This makes it diffiult to creat isometric plots that look good.

Posted: Thu May 12, 2005 7:43 am
by Pep
Hi Klint,

Yes, it will show you "0" which means that it's set to automatic, but you should be able to calculate the increment using the OnGetNextAxisLabel event (giving its labels values).

About the Isometric plots, you can see an isometric axis example into the Demo Features project of the latest TeeChart Pro vcl v7.04.