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


I am using the WPF version = 1.3.1040.

I am building a user interface based on SciChart Trader application however I am using the MVVM pattern.

I am trying to use the SeriesSelectionModifier but cannot seem to make that work.
I added a toggle button to the application so that I can enable a selection mode.
If I load some line series, select the selection tool, and click on a line, my application generates references the collection of selected lines, but that collection is empty.

I load all my modifiers using code (in the same place) for each chart so here is the code where I defines the selection modifier. Note that I set IsEnable = true via a toggle button like in the trader application.

SeriesSelectionModifier seriesSelectionModifier = new SeriesSelectionModifier();
seriesSelectionModifier.IsEnabled = false;
Binding selectedSeriesBinding = new Binding();
selectedSeriesBinding.Path = new PropertyPath("SelectedHistoricalRenderableSeries");
selectedSeriesBinding.Mode = BindingMode.TwoWay;
seriesSelectionModifier.SetBinding(SeriesSelectionModifier.SelectedSeriesProperty, selectedSeriesBinding);
if (parent != null)
seriesSelectionModifier.SelectedSeriesStyle = parent.Resources["ChartSelectedSeriesStyle"] as Style;
seriesSelectionModifier.SelectedSeriesStyle = null;

Here is the definition of series I bind to:

private ObservableCollection<IRenderableSeries> _selectedHistoricalRenderableSeries = new ObservableCollection<IRenderableSeries>();
public ObservableCollection<IRenderableSeries> SelectedHistoricalRenderableSeries
  get { return _selectedHistoricalRenderableSeries; }
    _selectedHistoricalRenderableSeries = value;

Can you see from this what else I may need to do?

  • You must to post comments

Hello again 🙂

The series selection modifier is a simple way to wrap up a common use-case, of getting the values of a selected series and/or styling that series.

If you take a look at the Series Selection Demo here:

and click “Source code”, the SeriesSelection modifier does not require binding to anything – just drop it in the SciChartSurface. The SeriesSelection modifier alters the SciChartSurface.SelectedSeries property, which is what the legend binds to (also rollover), as well as the style of the selected series.

If you want to do anything other than that, it may be easier to write some custom code. Are you aware of our ChartModifier API? If you create a class that inherits ChartModifierBase you can create your own chart modifiers. In here you can override OnModifierMouseDown, OnModifierMouseMove, OnParentSurfaceRendered and perform all sorts of operations. Take a look at our tutorials section which presents a few posts on creating custom modifiers:

All the SeriesSelection modifier is using is the hit-test API which is also demonstrated by this example:

Hopefully somewhere in the above I’ve pointed you in the right direction!

Best regards,

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.