简体   繁体   English

如何从曲线项获取数组或y轴数据列表

[英]How to get an array or a list of y axis data from the curve item

I have a list item(myList) on the Zedgraph, 我在Zedgraph上有一个列表项(myList),

PointPairList myList = new PointPairList();

myList has some values in it, now I want to copy just the y values alone into a new array. myList中有一些值,现在我只想将y值单独复制到新数组中。

My Trails: 我的足迹:

myList.toArray(); // Seems to return a complete set of pointpair list
myList.GetRange(); // Gets a range of pointPair list

I'm looking to find a way, to copy just the y Data. 我正在寻找一种方法,仅复制y数据。

Thanks in advance....:) 提前致谢....:)

Use 采用

double[] yvalues = myList.Select(p => p.Y).ToArray();

For this you need to include System.Linq namespace this way 为此,您需要以这种方式包括System.Linq命名空间

using System.Linq;

您可以使用“ Select仅获取Y坐标。

var result = myList.Select(pointPair => pointPair.Y).ToArray();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM