Pre loader

Using a Context menu with RubberBandXyZoomModifier on right mouse button click with series selection issue/observation

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

-1
1

Hi All,

I’ve read the following forum entry on using a context menu with and ALT-Right click to get around problems with event interference:

https://www.scichart.com/questions/question/contextmenu-does-not-work-on-graph-when-panning-is-enabled-by-right-mouse-button

I have the same problem with zoom and implemented the solution mentioned above. Then I noticed on one of my test apps that the two would live side by side quite nicely without doing anything BUT it made selecting a scatter series trickier. i found that using ReceiveHandledEvents had an effect on the behaviour in that while this was false zoom and context were fine but selecting a series was a bit hit and miss, but while it was true the behaviour in the link was displayed i.e. context menu appearing after zoom operation.

Here’s the XAML;

        <s:SciChartSurface x:Name="ChartSurface" Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" s:ThemeManager.Theme="Chrome">

        <s:SciChartSurface.ContextMenu>
            <ContextMenu>
                <MenuItem Header="Item1" />
                <MenuItem Header="Item2" />
                <MenuItem Header="Item3" />
                <MenuItem Header="Etc.." />
            </ContextMenu>
        </s:SciChartSurface.ContextMenu>

        <s:SciChartSurface.XAxis>
            <s:DateTimeAxis AutoRange="Once"/>
        </s:SciChartSurface.XAxis>

        <s:SciChartSurface.YAxes>
            <s:NumericAxis x:Name="LinearAxis" Id="LinearAxis" AutoRange="Always" AxisAlignment="Left" AxisTitle="Linear" Style="{StaticResource LinearScaleStyle}"/>
        </s:SciChartSurface.YAxes>

        <s:SciChartSurface.ChartModifier>
            <s:ModifierGroup>
                <s:RubberBandXyZoomModifier x:Name="rubberBandZoomModifier" IsEnabled="True" IsXAxisOnly="False" IsAnimated="True" ExecuteOn="MouseRightButton" ZoomExtentsY="False" ReceiveHandledEvents="True"/>
                <s:ZoomPanModifier x:Name="zoomPanModifier" ExecuteOn="MouseLeftButton" ZoomExtentsY="False" ReceiveHandledEvents="True" IsEnabled="True" XyDirection="XDirection"/>

                <!--
                ReceiveHandledEvents * True = context menu appears on completion of a right mouse button zoom operation
                ReceiveHandledEvents * False = Zoom and Context menu are fine but selecting a series needs a slow double click type thing
                -->
                <s:SeriesSelectionModifier ReceiveHandledEvents="True">
                </s:SeriesSelectionModifier>
                <s:LegendModifier x:Name="SelectedSeriesLegend" ShowLegend="True" GetLegendDataFor="SelectedSeries" Margin="5" SourceMode="AllVisibleSeries" />
            </s:ModifierGroup>
        </s:SciChartSurface.ChartModifier>

    </s:SciChartSurface>

Can anyone explain this? Is there an accepted workaround? are there any other easy methods of selecting a series that don’t involve clicking on it (e.g. select from legend)?

Thanks in advance

/Stu

  • You must to post comments
0
0

Hi Stuart, if you point WPF Snoop at your application, and navigate to the Events tab, can you see what element is handling your event?

Images
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies