We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

SfChart cyclic update performance

Thread ID:

Created:

Updated:

Platform:

Replies:

150687 Jan 16,2020 07:59 AM UTC Apr 8,2021 11:55 AM UTC WPF 16
loading
Tags: SfChart
Michael Steiner
Asked On January 17, 2020 07:38 AM UTC

Hello,

In our application we are using a SfChart to plot data coming from a machine (temperature, force, position etc.). Currently we have up to 20 data series (FastLineBitmapSeries) which are updated every 100 ms. We now face the problem that we can't use more than 10 data series for more than 5 minutes or the application will start to freeze. We then created a quick test app which only uses a SfChart and saw that with 20 data series and 100ms cycle, the chart starts to freeze after about 6 minutes (having plotted about 72'000 data points by then).

EDIT: We also identified a problem when wanting to clear the graph. When just clearing the ObservableCollections it will slow down the application due to an ever increasing execute time of SfChart.UpdateArea method. When instantiating new ObservableCollections we could not observe that behaviour.

Sidenote: We know that using a StrokeThickness of 1 would further improve performance but for our application, which has a dark theme, we found that we need to have a StrokeThickness of 2 in order to improve readability.

Is there any other way to improve the performance of the chart for cylic updates?

Version: 16.4.0.42

Thanks in advance

Kind regards, 

Michael


Attachment: ChartTest_2818d9f7.7z

Emanuel
Replied On February 27, 2021 11:44 AM UTC

Hello,
I am also facing the problem of slow UpdateArea when clearing the observable collection. However I am also facing this issue when resetting the collection as well.
Did you manage to find any solution for this?

Thnaks, Emanuel

Michael Steiner
Replied On March 1, 2021 12:03 PM UTC

Hi Emanuel,

We weren't really able to eliminate the peformance issue for long runs. But one thing we noticed is that we had a memory leak with series that we did not use in our viewmodels anymore (called clear on the collection) but were still kept alive by the SfChart by some references. We solved this issue by calling Dispose on the SfChart whenever the view was disposed. This helped to solve the problem with slowing app over time.
Hope this helps you as well.

Yuvaraj Palanisamy [Syncfusion]
Replied On March 1, 2021 01:55 PM UTC

Hi Emanuel, 
  
We would like to suggest that to improve the performance by setting of ItemsSource to be null and then resetting the ItemsSource property. Also, please refer to the below steps to optimize the chart performance for live data for your reference,
 
      
 
·       Use FastLineBitmapSeries instead of if you are using FastLineSeries. 
·       Set the StrokeWidth of FastLineBitmapSeries to “1” by default value of it “2”. 
·       Set the EnableAntiAliasing property as false for FastLineBitmapSeries.   
·       Remove LabelFormat for Axis if any. 
·       Should not use ChartSeries ListenPropertyChange 
·       Set Minimum and Maximum as fixed for axis. 
 
For more details, please refer the below link. 
 
@ Michael Steiner – Thanks for your update. 
 
Regards, 
Yuvaraj 


Emanuel
Replied On March 5, 2021 10:51 PM UTC

Hello,

Thanks for the input. I also noticed the memory leak and I solved it by caching the views and the viewModels and disposing them accordingly as well as setting the intemSource to null.
The problem however still remains when the observable collection that holds the points is updated. Here is a screenshot of the profiler. It looks like the main culprit is Layout axis.

Thanks,
Emanuel