SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, iOS Chart, Android Chart and JavaScript Chart Components
We keep getting asked What’s the best practice way to suspend the SciChartSurface in a multi-pane stock chart demo.
We have multiple ways of doing this.
By far the most effective and thread-safe way to do this is to call SuspendUpdates directly on the SciChartSurface. But how to do this in a ViewModel?
Hi,
I’m using the MVVM pattern with my _chartSeries declared as:
ObjectModel.ObservableCollection(Of IChartSeriesViewModel)
What’s the recommended way to update (not append) data values in one of the data series?
I tried looking for something like _chartSeries]0].DataSeries.Update but couldn’t find anything.
Thanks,
–George
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
I saw in tips and tricks for performance the use of
scichartsurface.suspendupdate
before something is added to the dataseries. But usually I don’t have access in ViewModel to surface. How can I suspendupdate in the ViewModel when updating the series?
Is dataseries.SuspendUpdate used for this?
How exactly does the SuspendUpdates work? I was under the impression that the surface the ViewportManager is attached to should not be redrawn until the IUpdateSuspender was disposed.
using (var s = ViewportManager.SuspendUpdates())
{
// Clear ObservableCollection<IChartSeriesViewModel> that is databound to SciChartSurface.SeriesSource
// Add new IChartSeriesViewModel to ObservableCollection
}
The behavior I’m observing is after the clear it is blanking out the chart and then I see the new series drawn on the surface. I was expecting to see the chart immediately switch to the new series without first seeing the chart surface being cleared. Is this not the behavior of SuspendUpdates?
Hey
why do i need to use SuspendUpdates when i can append an array of data?
Thanks!