How to draw a large number of LineCollections in less than 1 second?

A forum dedicated to WPF version of LightningChart Ultimate.

Moderator: Queue Moderators

Post Reply
Saeid
Posts: 1
Joined: Sat Feb 12, 2022 5:01 am

How to draw a large number of LineCollections in less than 1 second?

Post by Saeid » Sat Feb 12, 2022 5:37 am

Hi
I have a chart inside wpf that I use None Bindable to draw values.
I also draw each value as a separate LineCollection.
The number of these quantities is large and may reach 30,000 or 40,000.
I did my test for about 100 of these values. Drawing these 100 numbers takes about 2-3 seconds.
I want to know if there is a way to draw a large number of LineCollection in NoneBindable mode and at very high speed? So that drawing 30,000 or 40,000 values takes less than 1-2 seconds?

thank you.

ArctionKestutis
Posts: 552
Joined: Mon Mar 14, 2016 9:22 am

Re: How to draw a large number of LineCollections in less than 1 second?

Post by ArctionKestutis » Mon Feb 14, 2022 11:55 am

The most effective rendering will be with smallest amount of series (in this case LineCollection). Instead of multiple LineCollection, you should add all segments (SegmentLine) to array of line-segments (lineCollection.Lines property).
At leastm you should group same color and line-width segments into same LineCollection.
Note that if your value should be connected as continues line, it is more efficient to use 'standard' line series. Depending on distribution of x-values, you can use PointLineSeries, FreeformPointLineSeries, SampleDataSeries, or SampleDataBlockSeries.

Even 100 LineCollection should not take 3 seconds to render. Make sure that you using BeginUpdate() and EndUpdate() method calls, to initiate Chart (properties) update as a batch.

Post Reply