SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components
I have a question concerning multithreaded access to the DataSeries:
We implemented an overview for our chart as described here. This works fine when we load data, add it to the series and then display it.
Now, for a certain use case we need to display live data. We implemented this in a background thread. We noticed that after some time the application freezes when the update frequency rises. In the documentation I found this:
NOTE: Considerations when a DataSeries is shared across multiple chart surfaces. Currently only a single parent chart is tracked, so DataSeries.SuspendUpdates() where the DataSeries is shared may have unexpected results.
I guess this is what is happening here…so what is the recommended approach to achieve something like this? Do we have to add the data on the UI thread if we want to have the Overview? Here it says:
When appending Data in a background thread, you cannot share a DataSeries between more than one SciChartSurface. You can still share a DataSeries between more than one RenderableSeries.
Does that mean we should create more different RenderableSeries for the main chart surface and the overview surface that are based on the same DataSeries? Any help would be appreciated!
Thanks for your question. So concerning this, it is just as the documentation says, you cannot share a DataSeries between multiple SciChartSurfaces when appending from a background thread.
Since the example contains two SciChartSurfaces, you cannot use same DataSeries for RenderableSeries from both SciChartSurfaces if updating it from a bacjground thread. In this case you will need either to copy the data and create additional DataSeries for Overview’s SciChartSurface, or have one shared DataSeries and update it on the UI thread.
Hope this helps!
Please login first to submit.