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
Nevron Support
Posted 12 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 4,009

Hello Xiaolong,

You can try using the line chart sampling feature.

The following example demonstrates Sampled 2D Line: All Examples >> Chart Gallery >> Line >> Sampled 2D Line

The online example is available at: Sampled 2D Line

 

You can also take a look at the following KB topic: Enable sampling for the line series chart



Best Regards,
Nevron Support Team



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