Page 1 of 1

AtuoScales, margins, datetime labels

Posted: Mon Mar 23, 2009 3:49 pm
by 5886715
Hi,
I have a real-time teechart with fastlines that uses auto scaling for both the Y-axis (sensor measurements) and the bottom axis (Date-time). I have 2 questions.

1) My measurements start at 0 and then jumps up to about 25 (plus/minus 0.001). The left axis auto scaling sets the scale from 0 to 25. As a result, the data line is difficult to see because it is either all the way on the bottom of the plot (at 0) or all the way at the top of the plot (at about then maximum, 25). Is there a way to increase the scales a little (say 10% of the scale range) so the data line is slightly above the bottom and below the top of the plot? This would make the data plot much easier to see.

2) My plot's bottom axis is DateTime. Although the axis is auto scaling it does not automatically change the date label (i.e. If I set the label format to h:mm I can not see seconds when the test starts. If I change the label format to include seconds the axis labels looks silly after the test has been running for several days => we do not need to show seconds anymore). How can I get the DT labels to automatically change formats for the date-time range?
I am using Delphi 6 with Teechart 8.04
Thanks
Robert

Posted: Tue Mar 24, 2009 11:51 am
by 5886715
Where can I put a "display label procedure"to change the DateTime lables depending on the plots date-time range. It is easy to "manually" adjust the display formats but I am not sure where the procedure should be called from. Which OnEvent is best?

Is there a hidden OnAfterAutoScaling event available so that I call a procedure to manually adjust the Left axis to give some space on the chart so that the plot can clearly been seen? If not is it possible to add a "magnification factor" to the autoscale routine so the automatic scales are slightly greater than the data (min and max)?

Posted: Tue Mar 24, 2009 3:16 pm
by narcis
Hi Robert,
Where can I put a "display label procedure"to change the DateTime lables depending on the plots date-time range. It is easy to "manually" adjust the display formats but I am not sure where the procedure should be called from. Which OnEvent is best?
I'd try parsing labels or setting their format in the OnGetAxisLabel or OnGetNextAxisLabel events.
Is there a hidden OnAfterAutoScaling event available so that I call a procedure to manually adjust the Left axis to give some space on the chart so that the plot can clearly been seen? If not is it possible to add a "magnification factor" to the autoscale routine so the automatic scales are slightly greater than the data (min and max)?
Yes, you can use axes MinimumOffset and MaximumOffset properties for that.

Hope this helps!

Posted: Thu Mar 26, 2009 1:40 pm
by 5886715
Hi NarcĂ­s,
Thanks for the info... your suggestions worked great!