Group: Forum Members
Last Active: 11 Years Ago
Posts: 18,
Visits: 1
|
Hi experts
i need to draw about one million of line segments in NChart, currently it would take ~15 seconds, so is there any method to optimize the performance? the following is the code i use,
var series = (NLineSeries)_chart.Series.Add(SeriesType.Line); series.UseXValues = true; series.BorderStyle.Width = new NLength(2); series.DataLabelStyle.Visible = false; series.InflateMargins = true;
for (int i = 0; i < lineDataSeries.XValues.Count; i++) { var pt = new NDataPoint(lineDataSeries.XValues[i].ToOADate(), lineDataSeries.YValues[i]);
pt[DataPointValue.StrokeStyle] = new NStrokeStyle(1.5f, lineDataSeries.Colors[i]);
series .AddDataPoint(pt); }
thanks
xiaolong
|