I'm using FreeformLineSeries.AddPoint() in a real-time refresh application. I found that I've added point is more than I real added, that is the series.PointCount not equal to series.Points.Length! My application need change series.PointCountLimitEnabled in run-time, when I set PointCountLimitEnabled to true, unexpected point is lost. Code as follow:
Code: Select all
List<SeriesPoint> pts = new List<SeriesPoint>();
Random rand = new Random(Environment.TickCount);
for (int i = 0; i < 20; i++)
pts.Add(new SeriesPoint { X = i, Y = rand.Next(50) });
//series.Points = pts.ToArray(); // This approach is Okay, series.PointsCount == series.Points.Length
series.AddPoints(pts.ToArray(), false); // series.PointsCount != series.Points.Length
series.PointCountLimitEnabled = true;
Is there any way to solve this situation?
Attachment is my solution, please download.
Thx.