Y axis label control - unable to find/use APIs

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Jeff S
Newbie
Newbie
Posts: 13
Joined: Thu Jul 03, 2003 4:00 am

Y axis label control - unable to find/use APIs

Post by Jeff S » Wed Aug 25, 2004 7:47 pm

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!

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

Post by Marjan » Thu Aug 26, 2004 3:54 pm

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.
Marjan Slatinek,
http://www.steema.com

Jeff S
Newbie
Newbie
Posts: 13
Joined: Thu Jul 03, 2003 4:00 am

labeling the Y axis using OnGetAxisLabel

Post by Jeff S » Thu Aug 26, 2004 8:18 pm

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!

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

Post by Pep » Thu Sep 02, 2004 2:33 pm


Post Reply