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()
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 newSeries
and insert the data points one by one to itsPoints
collection in a loop.