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

Welcome to the SciChart Community Forums!

Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy

We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!

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 problemIn first and third pic it works wellBut when i move cursor bellow middle, it doesnt
  • VRueda
    Thanks, now works wellAnd one more questionNow 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.