場景 WInforn中設置ZedGraph的焦點顯示坐標格式化以及顯示三個坐標數的解決辦法: https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/details/102466190 Winform中實現ZedGraph的多條Y軸(附源碼下載): htt ...
場景
WInforn中設置ZedGraph的焦點顯示坐標格式化以及顯示三個坐標數的解決辦法:
https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/details/102466190
Winform中實現ZedGraph的多條Y軸(附源碼下載):
https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/details/100132245
在多條曲線中,滑鼠雙擊面板,彈窗顯示距離焦點最近的坐標的值。
效果
註:
博客主頁:
https://blog.csdn.net/badao_liumang_qizhi
關註公眾號
霸道的程式猿
獲取編程相關電子書、教程推送與免費下載。
實現
雙擊事件綁定
zgc.DoubleClickEvent += zgc_DoubleClickEvent;
其中zgc
ZedGraphControl zgc
實現方法
private static bool zgc_DoubleClickEvent(ZedGraphControl sender, MouseEventArgs e) { PointF mousePt = new PointF(e.X, e.Y); CurveItem nearstCurve; int i ; Global.zedGraphControl1.GraphPane.FindNearestPoint(mousePt, out nearstCurve,out i); if (nearstCurve != null && nearstCurve.Points[i]!= null) { Double x = nearstCurve.Points[i].X; Double y = nearstCurve.Points[i].Y; string title = Global.zedGraphControl1.GraphPane.XAxis.Title.Text; DevExpress.XtraEditors.XtraMessageBox.Show("索引值:" + i + " X:" + x + " Y:" + y + " Xtitle:" + title); } return true; }