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
- Ian Carson asked 10 years ago
- last edited 9 years ago
- You must login to post comments
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
- Andrew Burnett-Thompson answered 10 years ago
-
Hi Andrew Didn'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 info Regards Ian
- You must login to post comments
Please login first to submit.