首页 技术 正文
技术 2022年11月11日
0 收藏 450 点赞 2,276 浏览 889 个字

场景

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

在多条曲线中,鼠标双击面板,弹窗显示距离焦点最近的坐标的值。

效果

Winform中设置ZedGraph鼠标双击获取距离最近曲线上的点的坐标值

注:

博客主页:
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;
}
相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,000
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,512
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,358
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,141
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,771
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,849