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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

incremental update of the SFChart ItemsSource

Thread ID:

Created:

Updated:

Platform:

Replies:

121800 Jan 26,2016 08:01 PM UTC Jan 28,2016 04:09 AM UTC WPF 3
loading
Tags: SfChart
Janosch Kunczik
Asked On January 26, 2016 08:01 PM UTC

Hello,

I am currently implementing a monitor, which displays waveforms  like in an oscilloscope. For this purpose I used the SFChart and created an ObservableCollection, which holds the data. I use the ObservableCollection like a ring buffer. This means its items don't change (because I don't remove or add items). Only the data inside of the list items changes over time. Because of that having an ObservableCollection is almost useless, since the PropertyChanged event only fires when items are added or removed. To update my SfChart nevertheless, I currently set the ItemSource = null and then again to the changed ObservableCollection. This forces a complete redraw of the chart. While this solution works, I have a few problems with that:
  • The garbage collection works almost the whole time, because of the huge amount of data I discard and reassign.
  • The redraw process takes more CPU load than necessary.

Is there a way to only update parts of the ItemSource in a SfChart? If yes, would it be possible to animate this?

Thanks,

Janosch


Sumathi Jayaraj [Syncfusion]
Replied On January 27, 2016 10:49 AM UTC

Hi Janosch,

Thanks for contacting Syncfusion support.

We are able to achieve your requirements by using "ListenPropertyChange" property in the ChartSeries and INotifyPropertyChanged in the Model class. Please find the sample code of this property.

Code example[XAML]:



<!--Listen property change is used to call OnPropertyChanged of property when that property value is changed-->

<chart:FastLineSeries StrokeThickness="2" ListenPropertyChange="True" XBindingPath="Period"
                    YBindingPath="Value" x:Name="series"/>


We have prepared a sample for your requirements and please find the sample in the following location.

SampleOscilloscope


Please find the following link for more information.

Link: http://help.syncfusion.com/wpf/sfchart/performance


Regards,
Sumathi J


Janosch Kunczik
Replied On January 27, 2016 01:20 PM UTC

Sumathi,

Thank you for the excellent help!

Regards,

Janosch

Sumathi Jayaraj [Syncfusion]
Replied On January 28, 2016 04:09 AM UTC

Hi Janosch,

Thanks for the update. Please let us know if you have any queries.

Regards,
Sumathi J

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;