CalcPosPoint problem
Posted: Mon Feb 07, 2005 9:15 pm
I am trying to use a vertical axis OnDrawLabel event handler to format my labels before displaying them. The values that I am calculating are numerically incorrect.
In the following code (simplified to show the error), RawY returns the incorrect value of 3.5798489669108.
Text contains the correct value of "3.400".
I don't understand the disparity between the value that TeeChart used to create the correct Text string and the value that is returned by CalcPosPoint().
In the following code (simplified to show the error), RawY returns the incorrect value of 3.5798489669108.
Text contains the correct value of "3.400".
I don't understand the disparity between the value that TeeChart used to create the correct Text string and the value that is returned by CalcPosPoint().
Code: Select all
//-------------------------------------------------------------------------
// DrawVoltageAxisLabel
//-------------------------------------------------------------------------
void __fastcall TFrameChartRecorder::DrawVoltageAxisLabel(TChartAxis* Sender, int &X, int &Y, int &Z, AnsiString &Text, bool &DrawLabel)
{
double RawY = Sender->CalcPosPoint(Y);
double YValue = RoundTo(RawY, -2);
Text = Format("%0.2n", ARRAYOFCONST((YValue)));
}