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

0
0

Hello

Im doing mutual crosshair, like this

static class ModifierFactory
{
    public static ModifierGroup Crosshair () 
    {
        SeriesSelectionModifier SelSerMod = new SeriesSelectionModifier() { SelectedSeriesStyle = new Style(typeof(BaseRenderableSeries)) { }, ExecuteOn = ExecuteOn.MouseRightButton };
        LegendModifier LegendModifier = new LegendModifier() { GetLegendDataFor = GetLegendDataFor.SelectedSeries, };

        MouseWheelZoomModifier MouseWheelZoomModifier = new MouseWheelZoomModifier() { ReceiveHandledEvents = true };
        ZoomPanModifier ZoomPanModifier = new ZoomPanModifier() { ReceiveHandledEvents = true };
        ZoomExtentsModifier ZoomExtensModifier = new ZoomExtentsModifier() { ReceiveHandledEvents = true, ExecuteOn = ExecuteOn.MouseDoubleClick };
        CursorModifier CursorModifier = new CursorModifier() { ReceiveHandledEvents = true };
        RolloverModifier RolloverModifier = new RolloverModifier() { ReceiveHandledEvents = true };

        return  new ModifierGroup(CursorModifier, MouseWheelZoomModifier, ZoomPanModifier, ZoomExtensModifier) {  MouseEventGroup = "MyGroup" };
    }

    public static ModifierGroup Rollover ()
    {
        SeriesSelectionModifier SelSerMod = new SeriesSelectionModifier() { SelectedSeriesStyle = new Style(typeof(BaseRenderableSeries)) { }, ExecuteOn = ExecuteOn.MouseRightButton };
        LegendModifier LegendModifier = new LegendModifier() { GetLegendDataFor = GetLegendDataFor.SelectedSeries, };

        MouseWheelZoomModifier MouseWheelZoomModifier = new MouseWheelZoomModifier() { ReceiveHandledEvents = true };
        ZoomPanModifier ZoomPanModifier = new ZoomPanModifier() { ReceiveHandledEvents = true };
        ZoomExtentsModifier ZoomExtensModifier = new ZoomExtentsModifier() { ReceiveHandledEvents = true, ExecuteOn = ExecuteOn.MouseDoubleClick };
        CursorModifier CursorModifier = new CursorModifier() { ReceiveHandledEvents = true };
        RolloverModifier RolloverModifier = new RolloverModifier() { ReceiveHandledEvents = true };

        return new ModifierGroup(RolloverModifier, ZoomPanModifier, MouseWheelZoomModifier, ZoomExtensModifier) { MouseEventGroup = "MyGroup" };
    }

    public static ModifierGroup SimpleModifier() 
    {
        SeriesSelectionModifier SelSerMod = new SeriesSelectionModifier() { SelectedSeriesStyle = new Style(typeof(BaseRenderableSeries)) { }, ExecuteOn = ExecuteOn.MouseRightButton };
        LegendModifier LegendModifier = new LegendModifier() { GetLegendDataFor = GetLegendDataFor.SelectedSeries, };

        MouseWheelZoomModifier MouseWheelZoomModifier = new MouseWheelZoomModifier() { ReceiveHandledEvents = true };
        ZoomPanModifier ZoomPanModifier = new ZoomPanModifier() { ReceiveHandledEvents = true };
        ZoomExtentsModifier ZoomExtensModifier = new ZoomExtentsModifier() { ReceiveHandledEvents = true, ExecuteOn = ExecuteOn.MouseDoubleClick };
        CursorModifier CursorModifier = new CursorModifier() { ReceiveHandledEvents = true };
        RolloverModifier RolloverModifier = new RolloverModifier() { ReceiveHandledEvents = true };

        return new ModifierGroup(ZoomPanModifier, MouseWheelZoomModifier, ZoomExtensModifier) { MouseEventGroup = "MyGroup" }; 
    }
}



SciChartSurface FirstChart;
SciChartSurface SecondChart;
...
...
FirstChart.ChartModifier = ModifierFactory.Crosshair ();
SecondChart.ChartModifier = ModifierFactory.Crosshair ();

But it is not mutual, every chart get single crosshair
Mb its because i got winForms project, which load wpf dll and open a wpf window ?

  • You must to post comments
1
0

Hi there,

You should use attached property MouseManager.MouseEventGroup=”MyGroup”, not this one which is exposed by modifiers – it is for internal usage.

Hope this helps!

Best regards,
Yuriy

  • VRueda
    It helps, but there is one problem In first and third pic it works well But when i move cursor bellow middle, it doesnt
  • VRueda
    Thanks, now works well And one more question Now all window will have mutual modifier with the same MouseGroup, is there any solution to divide modifier by window? (I understand that i can make unique MouseGroup's name for window, but mb u have another solution )
  • Andrew
    Bind MouseEventGroup to a GUID in the ViewModel, this will keep them distinct for your application. Hope that helps!
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

SciChart WPF v6 BETA released! Note pricing/licensing changes are coming. Contact us to beat the rise!Read more
+