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


Hi All,

Today’s weirdness was hard to track down but I can now demonstrate it with minimal code.

As a summary to the problem – we may generate multiple user controls each containing a chart that can’t all be viewed on screen at the same time. Our solution was to wrap everything in a ScrollViewer and allow the user to scroll through them. This caused the x Axis and any Right Aligned axis to do weird things with the chart.

On careful observation we noticed that any mouse movements in the axis while dragging were being interpreted as drags on the chart area so it would zoom (or pan) accordingly instead of dragging the Axis in question. Setting the scrollviewer scrollbar visibility to disabled returned the chart to expected behavior.

Can someone tell me what we did wrong or provide a work around suggestion.


<UserControl x:Class="WpfUITest.SciChartMultiaxisTest"
         xmlns:mc="" `enter code here`
         d:DesignHeight="300" d:DesignWidth="300">
    <!-- <ScrollViewer CanContentScroll="False" VerticalScrollBarVisibility="Disabled" HorizontalScrollBarVisibility="Disabled">  THIS IS OK   -->
    <ScrollViewer CanContentScroll="False" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
            <s:SciChartSurface x:Name="UserControlSciChartSurface" s:ThemeManager.Theme="Chrome" >
                    <s:NumericAxis AxisAlignment="Bottom" AxisTitle="XAxis 1" GrowBy="0.01,0.01"/>            

                    <s:NumericAxis x:Name="Left1" Id="Left1" AxisTitle="Left Axis" AxisAlignment="Left" />
                    <s:NumericAxis x:Name="Right1" Id="Right1" AxisTitle="Right Axis" AxisAlignment="Right" />                        

                        <!-- <s:ZoomPanModifier x:Name="ZoomPanModifier" ExecuteOn="MouseLeftButton" />  -->
                        <s:RubberBandXyZoomModifier x:Name="rubberBandZoomModifier" ExecuteOn="MouseLeftButton"/>
                        <s:ZoomExtentsModifier x:Name="zoomExtentsModifier" ExecuteOn="MouseDoubleClick"/>                            
                        <s:XAxisDragModifier x:Name="xAxisDragModifier" IsEnabled="True" ClipModeX="None" />
                        <s:YAxisDragModifier AxisId="Left1" IsEnabled="True" />
                        <s:YAxisDragModifier AxisId="Right1" IsEnabled="True"/>

I put a simple test series on from the code behind as follows:

        public void AddTestDataSeries()
        XyDataSeries<int, int> testSeriesData = new XyDataSeries<int, int> { SeriesName = "Series1" };
        for(int x = 1; x < 10; x++)
            testSeriesData.Append(x, x);
        FastLineRenderableSeries testSeries = new FastLineRenderableSeries();
        testSeries.DataSeries = testSeriesData;
        testSeries.YAxisId = "Left1";
        testSeries.SeriesColor = Colors.Red;

Any ideas anyone?

  • You must to post comments
Showing 0 results
Your Answer

Please first to submit.