什锦锉规格,陆小凤传奇之海兰花,莱雅娜的坠饰
方法一:鼠标点击波形
鼠标点击波形,显示点击位置的x,y值
private void chart1_mouseclick(object sender, mouseeventargs e) //chart1是你建的chart控件,实际名字根据你自己代码里的命名
{
hittestresult hit = chart1.hittest(e.x, e.y);
if (hit.series != null)
{
var xvalue = hit.series.points[hit.pointindex].xvalue;
var yvalue = hit.series.points[hit.pointindex].yvalues.first();
textbox1.text = string.format("{0:f0},{1:f0}", "x:"+xvalue, "y:"+yvalue);//textbox1也是自己建的一个专门用来显示的内容框,也可以用messagebox直接弹出内容
}
else
{
textbox1.text="未点击到波形曲线";
}
}
调用方法:
chart1.mouseclick += new mouseeventhandler(chart1_mouseclick);
方法二:鼠标移动到相应点位自动显示相关数值
private void chart1_mousemove(object sender, mouseeventargs e)
{
var area = chart1.chartareas[0];
double xvalue = area.axisx.pixelpositiontovalue(e.x);
double yvalue = area.axisy.pixelpositiontovalue(e.y);
textbox1.text = string.format("{0:f0},{1:f0}", xvalue, yvalue);
}
调用方法:
chart1.mousemove += new mouseeventhandler(chart1_mousemove);
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
Blazor server side 自家的一些开源的, 实用型项目的进度之 CEF客户端
.NET IoC模式依赖反转(DIP)、控制反转(Ioc)、依赖注入(DI)
vue+.netcore可支持业务代码扩展的开发框架 VOL.Vue 2.0版本发布
网友评论