Pre loader

How to make the ChartModifer works in MVVM

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

Closed
1
0

Hi I tried to bind the ChartModifer to a property in the VM. But though it build successful, and there is no warning or errors when I run the application , but the ChartModifier does not work.

Here is my code

    <sci:SciChartSurface Grid.Row="1" 
                         YAxes="{sci:AxesBinding YAxes}"
                         XAxes="{sci:AxesBinding XAxes}"
                         RenderableSeries="{sci:SeriesBinding RenderableSeries}"
                         Background="{Binding ChartBackBrush}"
                         Foreground="{Binding ChartForeBrush}"
                         ViewportManager="{Binding ViewportManager}"
                         ChartModifier="{Binding ChartModifiers}">
    </sci:SciChartSurface>

In ViewModel, I created all the child for the ChartModifiers. But it does not work.

        ChartModifiers = new ObservableCollection<IChartModifier>();
        //ModifierGroup.ChildModifiers
        ChartModifiers.Add(rubberBandXyZoomModifier);
        ChartModifiers.Add(new ZoomPanModifier()
        {
            ExecuteOn = ExecuteOn.MouseRightButton,
            ClipModeX = SciChart.Charting.ClipMode.None
        });
        ChartModifiers.Add(new ZoomExtentsModifier());
        ChartModifiers.Add(new MouseWheelZoomModifier());
        rolloverModifer = new RolloverModifier()
        {
            ExecuteOn = ExecuteOn.MouseMove,
            ShowTooltipOn = RolloverVisible
        };
        ChartModifiers.Add(rolloverModifer);

        xAxisDrag = new XAxisDragModifier()
        {
            IsEnabled = true,
            ClipModeX = SciChart.Charting.ClipMode.None,
            DragMode = SciChart.Charting.AxisDragModes.Pan
        };
        yAxisDrag = new YAxisDragModifier()
        {
            IsEnabled = true,
            DragMode = SciChart.Charting.AxisDragModes.Pan
        };

        ChartModifiers.Add(xAxisDrag);
        ChartModifiers.Add(yAxisDrag);
Version
5.3.0.11954
  • Andrew Burnett-Thompson
    Hi zhiyu, I asked you before to activate your SciChart license to receive tech support. Could you do this please? Else we will have to disregard questions you ask. Instructions are here: http://www.scichart.com/activating-scichart. Thank you!
  • Tim
    I think, to get access to the ChartModifiers in your viewModel you have to bind your ObservableCollection to the ChildModifiers of the ModifierGroup.
  • You must to post comments
Showing 0 results