3,245
社区成员
发帖
与我相关
我的任务
分享
void CChartADODlg::OnOnMouseMoveTchart1(long Shift, long X, long Y)
{
// TODO: Add your control notification handler code here
m_chart.Repaint();
long x1,y1,x2,y2;
x1 = m_chart.GetAxis().GetLeft().GetPosition();
y1 = m_chart.GetAxis().GetTop().GetPosition();
x2 = m_chart.GetAxis().GetRight().GetPosition();
y2 = m_chart.GetAxis().GetBottom().GetPosition();
if (X>=x1&&Y>=y1&&X<=x2&&Y<=y2)
{
m_chart.GetCanvas().DrawLine(x1,Y,x2,Y);
m_chart.GetCanvas().DrawLine(X,y1,X,y2);
}
DOUBLE posX,posY;
posX = m_chart.GetAxis().GetBottom().CalcPosPoint(X)+1;
posY = m_chart.GetAxis().GetLeft().CalcPosPoint(Y);
dataX = posX;
dataY = posY;
CString cs;
cs.Format("posX:%f posY:%f\r\n",posX,posY);
TRACE(cs);
SetDlgItemText(IDC_STATIC_X,cs);
}