.net 4 vs2010 winform c#
使用
添加了一些观点chart1.Series[0].Points.AddXY(x,y);
然后使用
缩放x轴chart1.ChartAreas[0].AxisX.ScaleView.Zoom(a,b);
是否有任何方法可以返回屏幕上的所有点(b> point.Xvalue> a)
谢谢!
答案 0 :(得分:1)
通过使用LINQ,您可以执行以下操作:
DataPointCollection points = chart1.Series[0].Points;
IEnumerable<DataPoint> range =
from p in points
where p.XValue > a && p.XValue < b
select p;
range
包含XValue大于a
且小于b
的所有数据点。