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 valueCodePudding user response:
Reference TeeChart own relevant example code,