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)));
}