Page 1 of 1

TChartAxis location in pixels

Posted: Wed Nov 07, 2007 5:28 pm
by 9335230
Hi,

I need a way to know the exact position of the begin and end of one
TChartAxis. In the case of the BottomAxis, It is not always possible to
get it from this sentence:

int xBegin = chart->BottomAxis->CalcPosValue(chart->BottomAxis->Minimum)

because there are cases in which that would be incorrect, like in the
case of a TBarSeries in the chart.

Is there any method I can use?

Thanks in advance.

Posted: Thu Nov 08, 2007 10:28 am
by narcis
Hi beetle,

Yes, you can use Chart1.Axes.Bottom.IStartPos and Chart1.Axes.Bottom.IEndPos. Please notice that those properties only have valid values when the chart has been drawn so, for example, you'd better use them in the OnAfterDraw event or make a Chart1.Draw call before retrieving.

Posted: Thu Nov 08, 2007 12:41 pm
by 9335230
Hi NarcĂ­s,

That is exactly what I needed to calculate positions of some chart tools I have made.
Thank you very much.

Beetle.