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.
how to get increment from automatic axis?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
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:
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';
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
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.
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.
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.
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.
Pep Jorge
http://support.steema.com
http://support.steema.com