locked
Chart Axes intervals and lineseries RRS feed

  • Question

  • Hi,

    Using the below code i could change the x and y axis intervals but the graph is not chaging based on that. I want the lineseries should change based on the intervals. Is that possible?

    XAML:

     <wpfTool:Chart Name="mcChart" DockPanel.Dock="Top" DragLeave="Chart_DragLeave" AllowDrop="True" Width="500" Height="500" PreviewMouseWheel="mcChart_PreviewMouseWheel"
                   MaxHeight="500" MaxWidth="500"  PreviewDragLeave="mcChart_PreviewDragLeave">
                <wpfTool:Chart.Axes>
                    <wpfTool:DateTimeAxis Name="XAxis" Orientation="X" ShowGridLines="True" AllowDrop="True" />
                    <wpfTool:LinearAxis Name="YAxis" Orientation="Y"  ShowGridLines="True" AllowDrop="True" />
                </wpfTool:Chart.Axes>

     <wpfTool:LineSeries Name="Line1" IsSelectionEnabled="True"
                        ItemsSource="{Binding Path=Data1}"
                        IndependentValuePath="Date"
                        DependentValuePath="Value"/>
                <wpfTool:LineSeries Name="Line2"
                        ItemsSource="{Binding Path=Data2}"
                        IndependentValueBinding="{Binding Date}"
                        DependentValueBinding="{Binding Value}"/>           
            </wpfTool:Chart>

    XAML.cs: private void mcChart_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
            {
                  if (e.Delta > 0)
                {
                    XAxis.Interval -= 0.5;
                    YAxis.Interval -= 0.5;
                }
                else
                {
                    XAxis.Interval += 0.5;
                    YAxis.Interval += 0.5;
                }
            }

    Thursday, September 18, 2014 11:51 AM

Answers

  • Hi,

    Because this is a 3rd party product, you'd better to ask question at its official website for better support: http://wpf.codeplex.com/discussions

    Thank you for your understanding.

    Best Regards,
    Franklin


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Proposed as answer by Just Karl Saturday, September 20, 2014 3:55 PM
    • Marked as answer by Just Karl Monday, September 29, 2014 10:48 PM
    Friday, September 19, 2014 4:56 AM