Page 1 of 1

BottomAxis

Posted: Mon Nov 13, 2006 11:42 am
by 9232247
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

Posted: Tue Nov 14, 2006 6:26 pm
by Marjan
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;

Posted: Wed Nov 15, 2006 11:52 am
by 9232247
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

Posted: Wed Nov 15, 2006 12:23 pm
by Marjan
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;