I have some very large data files that cannot fit into memory (many GB) so I have implemented scrolling myself. I am up for suggestions on the fastest way to scroll when you are adding data to the beginning of the points array.
The standard chart view size is 100 meters which is about 200,000 rows of data. I have 19 to 21 Y axes/PointLineSeries depending on the file.
Adding to the end of the points array when scrolling right is fairly straight forward, delete anything prior to what you want and add the small amount of points to the end.
Code: Select all
_chart.ViewXY.PointLineSeries[i].DeletePointsBeforeX(startPos);
_chart.ViewXY.PointLineSeries[i].AddPoints(locations, channelData, false);
Code: Select all
// Create an array of points for the new data
SeriesPoint[] frontPoints = new SeriesPoint[addToBegin];
// Move the read in data to the new points array
Parallel.For(0, addToBegin, k => { frontPoints[k].X = locations[k]; frontPoints[k].Y = channelData[k]; });
// Concat the new points and old points together
// Set the complete points array in the series
_chart.ViewXY.PointLineSeries[i].Points = frontPoints.Concat(_chart.ViewXY.PointLineSeries[i].Points.Take(_chart.ViewXY.PointLineSeries[i].PointCount - addToBegin)).ToArray();;