Profile Picture

Is there any way to promote the performance of drawing one million line segments

Posted By Xiaolong Zhu 12 Years Ago

Is there any way to promote the performance of drawing one million...

Author
Message
Xiaolong Zhu
Posted 12 Years Ago
View Quick Profile
Junior Member

Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)

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




Similar Topics


Reading This Topic