BottomAxis

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
FritsM
Newbie
Newbie
Posts: 6
Joined: Wed Apr 28, 2004 4:00 am
Contact:

BottomAxis

Post by FritsM » Mon Nov 13, 2006 11:42 am

Hallo,
I have a Financial Graph with DateTime on the bottom axis.
When I run my program, TempSeries might be created. If TempSeries are created, and only then, after the creation of one ore more TempSeries the DateTime of the BottomAxis changes to a value (indicating 271 and all the labels of the TempSeries show 271 irrespective of the datetime of the bottom axis)
How can I solve this to get the normal BottomAxis with DateTime values back?
Many thanks
Frits

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Post by Marjan » Tue Nov 14, 2006 6:26 pm

Hi.

When series is created then (by default) it's XValues.DateTime property is set to false meaning internal algorithm will treat x values as double and not as TDateTime. To change this, set the newly created series XValues.DateTime property to True:

Code: Select all

TempSeries.XValues.DateTime := True;
Marjan Slatinek,
http://www.steema.com

FritsM
Newbie
Newbie
Posts: 6
Joined: Wed Apr 28, 2004 4:00 am
Contact:

Post by FritsM » Wed Nov 15, 2006 11:52 am

Thanks for the answer Marjan!

The " Tempserie.XValues.DateTime := true;" does not work.
Somehow the Tempserie.Marks.XValue text is plotted on the BottomAxis of the ParentChart and it overwrites the DateTime on the bottomAxis.
I worked around the problem and Assigned the Tempseries.HorizAxis := ParentChart.TopAxis and made the ParentChart.TopAxix.Visible := false;
It is not a nice solution but this works fine for me for now.

If you have any suggestion what I have initially done wrong I would like to hear it.
Thanks again & Best regards
Frits

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Post by Marjan » Wed Nov 15, 2006 12:23 pm

Hi.

Perhaps you should also try to force the bottom axis labels to datetime by using the following code:

Code: Select all

// use series x values for axis labels
tChart1.Axes.Bottom.LabelStyle := talValue;
// or TempSeries.GetHorizAxis.LabelStyle := talValue;
Marjan Slatinek,
http://www.steema.com

Post Reply