【问题标题】:How to get the points in the current scaleView in chartarea c# winform?c# - 如何在chartarea c# winform中获取当前scaleView中的点?
【发布时间】:2013-01-05 13:37:17
【问题描述】:

.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)

谢谢!

【问题讨论】:

    标签: c# winforms visual-studio-2010 charts point


    【解决方案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 的所有数据点。

    【讨论】:

      猜你喜欢
      • 2016-04-23
      • 2017-02-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-05-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多