[英]How to get the points in the current scaleView in chartarea c# winform?
.net 4 vs2010 winform c# .net 4 vs2010 Winform C#
added some points using 使用添加了一些要点
chart1.Series[0].Points.AddXY(x,y);
then zoom the x axis using 然后使用
chart1.ChartAreas[0].AxisX.ScaleView.Zoom(a,b);
Are the any methods to return all the points on the screen (b> point.Xvalue >a) 是返回屏幕上所有点的任何方法(b> point.Xvalue> a)
Thank you! 谢谢!
By using LINQ, you can do the following: 通过使用LINQ,您可以执行以下操作:
DataPointCollection points = chart1.Series[0].Points;
IEnumerable<DataPoint> range =
from p in points
where p.XValue > a && p.XValue < b
select p;
range
contain all data points whose XValue is greater than a
and less than b
. range
包含XValue大于a
且小于b
所有数据点。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.