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
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,
Please login first to submit.