SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components

0
0

Hi Andrew

We would like to be able to set SuspendUpdates in an MVVM scenario as we are using ObservableCollection of IChartSeriesViewModel to drive chart datatemplates.

We are getting some flickering when updating multiple series on the chart due to y axis rescaling.

Is there a bindable property on the SciChartSurface we can use for this? Or do you have another approach?

Thanks in advance
Regards
Ian

  • You must to post comments
1
0

Hi Ian,

One surefire way of ensuring you don’t get flicker is to update your DataSeries on the UI thread. The renderer draws on the UI and so updates of the DataSeries on a background thread can cause flicker, e.g. if you Clear then Add data to a DataSeries and the render operation occurs between the two you will momentarily see the redraw.

Another way is yes, you can call SuspendUpdates via a DataSeries. See the DataSeries.SuspendUpdates() method, which works the same as on the ParentSurface. However, note this makes the assumption that there is a 1:1 relationship between DataSeries and SciChartSurfaces (you have not registered a DataSeries on two parent surfaces).

Finally a surefire way to do this is create an attached Behaviour which binds to a property in your view model, and sets SuspendUpdates() / calls Dispose() on the IUpdateSuspender when the property changes.

Hope this helps,
Andrew

  • Ian Carson
    Hi AndrewDidn't know about DataSeries.SuspendUpdates().That works nicely and fixed the problem. I have noted your warning about a 1-to-1 relationship - luckily not a problem for our solution currently.Thanks for the infoRegards Ian
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.