c#2010中的chart表格,显示出一个曲线之后,怎么通过点击曲线上的节点
1个回答
展开全部
private void chart1_MouseClick(object sender, MouseEventArgs e)
{
HitTestResult myTestResult = chart1.HitTest(e.X,e.Y);
if (myTestResult.ChartElementType == ChartElementType.DataPoint)
{
int i = myTestResult.PointIndex;
DataPoint dp = myTestResult.Series.Points[i];
double doubleXValue = (dp.XValue);
double doubleYValue = dp.YValues[0];
//弹窗。。。
MessageBox.Show(doubleXValue + "---" + doubleYValue);
}
}
{
HitTestResult myTestResult = chart1.HitTest(e.X,e.Y);
if (myTestResult.ChartElementType == ChartElementType.DataPoint)
{
int i = myTestResult.PointIndex;
DataPoint dp = myTestResult.Series.Points[i];
double doubleXValue = (dp.XValue);
double doubleYValue = dp.YValues[0];
//弹窗。。。
MessageBox.Show(doubleXValue + "---" + doubleYValue);
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询