Charting.DataPointCollection如何获取Range? [英] Charting.DataPointCollection how to get a Range?
问题描述
我有一个Charting.DataPointCollection,并且只想得到一部分数据。在列表中你可以像 list.GetRange(int index,int count);
,但在DataPointCollection中没有GetRange()。
我有这样的想法: DataPoints.Where(elem => DataPoints.IndexOf(elem)> = i&& DataPoints.IndexOf (elem)<= j)
但现在我有一个IEnumerable而不是DataPointCollection ...
如何获得DataPointCollection
尝试使用 IndexOf()
DataPoints.Skip(number).Take(number);
对于获得 DataPointCollection
我没有找到任何合理的方法直接转换。只有我想出了创建一个新的系列
并将数据点逐个插入到它的点
集合一个循环。
I have a Charting.DataPointCollection and want to get only a part of the data. In a List you can do it like list.GetRange(int index, int count);
but in DataPointCollection you don't have GetRange().
I had the idea of using something like that: DataPoints.Where(elem => DataPoints.IndexOf(elem) >= i && DataPoints.IndexOf(elem) <= j)
but now i have an IEnumerable instead of a DataPointCollection...
How can i get a DataPointCollection as a Part of another DataPointCollection?
Try this instead of using IndexOf()
DataPoints.Skip(number).Take(number);
As for getting result as the DataPointCollection
, I haven't found any reasonable way of converting it directly. Only thing I came up with is create a new Series
and insert the data points one by one to its Points
collection in a loop.
这篇关于Charting.DataPointCollection如何获取Range?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!