Pre loader

Drawing real-time data on SciChartSurface isn't fast enough.‏‏

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums


I receive data at a very high speed from a hardware board and need to plot it on a SciChartSurface.
the sample is FastLineRenderableSeries

   <s:SciChartSurface x:Name="sciChart0" MaxFrameRate="5" 
                s:VisualXcceleratorEngine.FallbackType="{x:Type s:HighQualityRenderSurface}"
                  <s:FastLineRenderableSeries   x:Name="RenderableSeries1" DataSeries="{Binding Series, 
                     Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>


while Series is XyDataSeries<double, double>
I created a thread that opens a socket (on port 3490) and all the information it receives it draws on the graph.
The problem is that if some time passes, and I stop the transmission of the data, it still draws what it has left to draw to “reach the end of the buffer”. It makes me realize that he is not keeping up with the transmission and it takes him more time to draw than the time it takes for the information to arrive.
(If I start the transmission and let it draw, and then stop quickly, it does stop immediately. The problem is if a lot of information arrives over time).
I wanted to ask if there is a way to speed it up in some way? (Maybe by giving up the plotting quality?)
Since I need to draw the information that arrives in real time and not information that arrived a few seconds ago…
The drawing is done by a separate thread:

i’m using Append():

Series.Append(double[XPoints] array, double[YPoints] array);
  • You must to post comments

Good morning

Sometimes when users append data point by point using DataSeries.Append() on a background thread, this can cause thread contention.

This is mentioned in our Performance Tips and Tricks documentation page.

NOTE: When data is appended in blocks, you get a single draw call at the end. You also reduce thread-contention if you are appending on a background thread and drawing on the UI thread. Finally, the above is simply more memory efficient as we only need to recalculate the additional memory required once, rather than per-point appended.

SciChart processes data so fast, we can process >100,000 updates to the DataSeries per second. However, if you update that fast, then SciChart will spend a lot of time in static overhead for dataseries updates. It’s better for performance to update more data, less often.

What I suggest is add some code before DataSeries append to throttle the updates a little. For example, if you buffer and batch append using Append(xArray, yArray) all points that arrive in a 20 millisecond window, this will greatly improve performance.

For further assistance , you could create a solution to reproduce the issue and pass to our engineers to optimise, however this requires an up to date support subscription.

Best regards

  • You must to post comments

By the way you also set MaxFrameRate = 5 on your code which means the chart will only redraw every 200 milliseconds.

Better to throttle the data going in and use batch append, you will see an order of magnitude speed improvement

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.