Page 1 of 1

Y axis label control - unable to find/use APIs

Posted: Wed Aug 25, 2004 7:47 pm
by 8438518
It seems this should be easy but I've been thru the tutorials, sample code and this forum and still can not figure it out. Warning: newbie at teechart.
Problem: We present performance data in tabular form and now with teechart have provided some simple graphs (area, bar, line and scatter).
Using TCustomSeries, TAreaSeries, and TBarSeries.
When the data is an elapsed time we convert milliseconds to a format:
d-hh:mm:ss:millisec where days could be anywhere from 1 to 1000. When we put this into a chart using AddXY() we have control over the label for the X axis but I also need to control it for the Y. It seems I should use OnGetAxisLabel() for this but I don't see how to associate the label with the Y data value. I can post existing code as needed but it's extremely basic (from all the sample stuff I've seen).
Thanks in advance!

Posted: Thu Aug 26, 2004 3:54 pm
by Marjan
Hi, Jeff.
the label with the Y data value
Normally the vertical axis labels are generated directly from series y values. So, in OnGetAxisLabel you can still transform vertical axis (original) label from string to float, do your transformation and then transform it back to string.
Or you could even use the custom axis labels feature we introduced in Teechart v6.01. There is an example of fully customizable axis labels available in Teechart demo. Especially, check the example under the "All Features -> Axes -> Labels -> Custom Labels" node. By using this trick you can simply cycle through all visible points and create custom axis labels for horizontal and vertical axis.

labeling the Y axis using OnGetAxisLabel

Posted: Thu Aug 26, 2004 8:18 pm
by 8438518
Thanks for the response!
Sounds like the OnGetAxisLabel method is the way to go for me; but
from the example code I can not determine the call sequence nor the
inheritance heirarchy that I need to implement.
Our code is relatively simple, we instantiate an instance of one of
the chart types
e.g.
TPointSeries* S = new TPointSeries(mChart);
where Chart::TChart* mChart;
do a minimal bit of setting parameters and then call AddXY() to
load the series
e.g.
S->AddXY(XValue, YValue, caption.c_str(), clTeeColor);
and finally show the graph
e.g.
S->ParentChart = mChart;
From the example code, I'm not sure how to plug it into what we have...
Any pointers would be greatly appreciated!

Posted: Thu Sep 02, 2004 2:33 pm
by Pep