WPF Charting Documentation - SciChart WPF Charts SDK v5.x
MVVM DataSeries / RenderableSeries API

SciChart features a rich, true MVVM API for manipulating DataSeries and RenderableSeries. This eclipses many other charts which only allow manipulation of series in the view or in code.

Anything you can achieve in code or XAML you can achieve in MVVM. Adding series, removing series, adding/updating data, changing series properties, changing point-markers, even applying styles can all be achieved with our MVVM API.

The SeriesBinding MarkupExtension

It all starts with the SeriesBinding MarkupExtension. This transforms a collection of IRenderableSeriesViewModel derived types into RenderableSeries for display on the chart.

XAML

The SeriesBinding MarkupExtension
Copy Code
<!-- Declare a SciChartSurface with SeriesBinding -->
<!-- Where xmlns:s="http://schemas.abtsoftware.co.uk/scichart -->
<s:SciChartSurface RenderableSeries="{s:SeriesBinding RenderableSeriesViewModels}">

   <!-- XAxis, YAxis omitted for brevity -->
  
</s:SciChartSurface>

ViewModel

ViewModel
Copy Code
private ObservableCollection<IRenderableSeriesViewModel> _renderSeriesViewModels;
public ObservableCollection<IRenderableSeriesViewModel> RenderableSeriesViewModels
{
   get { return _renderSeriesViewModels; }
   set
   {
      _renderSeriesViewModels = value;
         OnPropertyChanged("RenderableSeriesViewModels");
   }
}

IRenderableSeriesViewModel Derived Types

SciChart includes a number of IRenderableSeriesViewModel derived types. These include:

Adding, modifying or removing an instance of one of these ViewModels to a collection bound via SeriesBinding to the SciChartSurface will cause the series to be shown/modified.hidden on the SciChartSurface.

 

 


SCICHART ® is a Registered Trademark in the UK, US and EEC. Copyright SciChart Ltd 2011-2018.

Email us to give feedback!