CalcPosPoint problem

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Leroy Casterline
Newbie
Newbie
Posts: 50
Joined: Wed Mar 10, 2004 5:00 am

CalcPosPoint problem

Post by Leroy Casterline » 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().

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

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

Post by Marjan » Fri Feb 11, 2005 6:55 am

Hi.

I think the problem is X and Y store the left-top position for axis label text. I wouldn't use this values for screen->axis value transformation.
Marjan Slatinek,
http://www.steema.com

Post Reply