获取鼠标点的X轴\Y轴坐标可以通过以下的方式:
private void GetChartPoint(int x1, int y1, ref double x, ref double y)
{
PointF mousePt = new PointF(x1, y1);
GraphPane pane = this.MasterPane.FindChartRect(mousePt);
// 判断鼠标是否在Chart内部
if (pane != null)
{
double y2;
pane.ReverseTransform(mousePt, out x, out y, out y2); // 转换坐标值
}
}想问如果知道曲线中的已知X轴、Y轴值,如何获取这个点相对整个zedgraph的location坐标。
private void GetChartPoint(int x1, int y1, ref double x, ref double y)
{
PointF mousePt = new PointF(x1, y1);
GraphPane pane = this.MasterPane.FindChartRect(mousePt);
// 判断鼠标是否在Chart内部
if (pane != null)
{
double y2;
pane.ReverseTransform(mousePt, out x, out y, out y2); // 转换坐标值
}
}想问如果知道曲线中的已知X轴、Y轴值,如何获取这个点相对整个zedgraph的location坐标。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货