Home > Software engineering >  Answer: VS2010, use TeeChart, according to the mouse display value cannot be converted to the coordi
Answer: VS2010, use TeeChart, according to the mouse display value cannot be converted to the coordi

Time:10-25

Using the TeeChart 5, give advice or comments please master,
The code is as follows:
Void CTeeChart2010Test1Dlg: : OnDblClickTchart1 ()
{
//TODO: add message handler code here
Double posX=0.0, posY=0.0;
CPoint point;
Char szColName [255]={0};
The GetCursorPos (& amp; Point);///get the mouse on the screen coordinates of the
CAxis axis=(CAxis) m_Chart. Get_Axis ();
CSeries lineSeriesTmp=(CSeries) m_Chart. Series (0);

PosX=axis. CalcPosPoint (point. X);//execute the statement is always an exception
PosY=axis. CalcPosPoint (point. Y);//execute the statement is always an exception

Cstrings posStr;
Sprintf (szColName, "[f] % \ r \ n", posX);
PosStr +=szColName;
Sprintf (szColName, "[% f]," posY);
PosStr +=szColName;
MessageBox (posStr, _T (" tip "), MB_OK);
}

CodePudding user response:

What is the mouse display values into charts coordinates?

CodePudding user response:

Whether GetCursorPos (& amp; Point); There is a problem, display values into charts coordinates is to replace the mouse screen coordinates with data on the coordinate value

CodePudding user response:

Reference TeeChart own relevant example code,
  • Related