how to get increment from automatic axis?

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
klint
Newbie
Newbie
Posts: 9
Joined: Tue Mar 01, 2005 5:00 am

how to get increment from automatic axis?

Post by klint » Fri Apr 29, 2005 1:36 am

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.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Apr 29, 2005 7:39 am

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';
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

klint
Newbie
Newbie
Posts: 9
Joined: Tue Mar 01, 2005 5:00 am

Post by klint » Wed May 04, 2005 1:31 am

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.

DJ
Newbie
Newbie
Posts: 17
Joined: Mon Apr 26, 2004 4:00 am
Location: So Cal

Post by DJ » Thu May 05, 2005 1:41 pm

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.

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Thu May 12, 2005 7:43 am

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.

Post Reply