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

0 votes

How can i add a regular menu : File (open, save , save as….), Edit …
the motivation is the draw a graphs by choosing the File->open from the menu

-1 votes

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:

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">

                <MenuItem Header="Item1" />
                <MenuItem Header="Item2" />
                <MenuItem Header="Item3" />
                <MenuItem Header="Etc.." />

            <s:DateTimeAxis AutoRange="Once"/>

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

                <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:LegendModifier x:Name="SelectedSeriesLegend" ShowLegend="True" GetLegendDataFor="SelectedSeries" Margin="5" SourceMode="AllVisibleSeries" />


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


1 vote

Hi Scichart,

I am struggling with a ContextMenu on a SciChartSurface that wont be displayed.

The problem started when i added mouse panning with the right mouse-button which is the same button the ContextMenu is activated on.

So will this combination even work – with both a ContextMenu and mouse panning with the right mouse button?

To manually validate if the ContextMenu should open or if the panning should be enabled, I have tried to get the mouse coordinates manually in C# to see if the mouse was moved(panning) or if it was a click(ContextMenu). This did not work very well when i afterwards started to pan/zoom again.

Do you have a code example using both a ContextMenu and mouse panning using right mouse button?

Best regards,

Showing 3 results
This template supports the sidebar's widgets. Add one or use Full Width layout.