chartview zooming with synced trackballs issue

2 posts, 0 answers
  1. Ryan
    Ryan avatar
    1 posts
    Member since:
    Nov 2015

    Posted 20 Jun Link to this post

    I have multiple charts that share the same x-axis and have the trackballs grouped using chartviewutilities.cs from one of your examples. Everything works as expected when there is no zoom. However as soon as I throw a grouped zoom and pan into the mix the trackballs get out of sync. The further I zoom the more out of sync they become. How can i resolve this? 

    Here is my charts xaml:

       <telerik:RadCartesianChart Margin="0,17,0,5" TrackBallInfoStyle="{StaticResource trackBallInfoStyle}" TrackBallLineStyle="{StaticResource trackBallLineStyle}" utils:ChartViewUtilities.ChartAlignmentGroup="g1" UseLayoutRounding="True" FontFamily="{DynamicResource FontFamilyRoboto}" Zoom="{Binding Zoom, Mode=TwoWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type View:MainWindow}}}" PanOffset="{Binding PanOffset, Mode=TwoWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type View:MainWindow}}}" MaxZoom="10000,10000">
                <telerik:RadCartesianChart.HorizontalAxis>
                    <telerik:CategoricalAxis SmartLabelsMode="SmartStep" Title="Strip Length (meters)" MajorTickStyle="{StaticResource tickStyle}"/>
                </telerik:RadCartesianChart.HorizontalAxis>
                <telerik:RadCartesianChart.VerticalAxis>
                    <telerik:LinearAxis SmartLabelsMode="SmartStepAndRange" MajorTickStyle="{StaticResource tickStyle}"/>
                </telerik:RadCartesianChart.VerticalAxis>
                <telerik:RadCartesianChart.Grid>
                    <telerik:CartesianChartGrid MajorLinesVisibility="Y" MajorYLineDashArray="3,4"/>
                </telerik:RadCartesianChart.Grid>
                <telerik:RadCartesianChart.Behaviors>
                    <telerik:ChartPanAndZoomBehavior ZoomMode="Horizontal" PanMode="Horizontal" />
                    <telerik:ChartTrackBallBehavior ShowIntersectionPoints="True" 
                                                        utils:ChartViewUtilities.ShouldPositionTrackBallCloseToDataPoint="False"
                                                        utils:ChartViewUtilities.TrackBallGroup="g1" TrackInfoUpdated="ChartTrackBallBehavior_TrackInfoUpdated"/>
                </telerik:RadCartesianChart.Behaviors>
                <telerik:LineSeries x:Name="SteelDNALineSeries" CategoryBinding="Position" 
                                            ValueBinding="Value" 
                                            ItemsSource="{Binding Trace, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:ParameterTraceControl}}}"
                                            TrackBallTemplate="{StaticResource SteelDNATrackBallTemplate}" Stroke="{Binding RandomColor, Mode=OneWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type View:MainWindow}}}" StrokeThickness="1"
                                            utils:ChartAnimationUtilities.CartesianAnimation="Rise"/>
            </telerik:RadCartesianChart>

     

    and attached are what happens...

  2. Martin Ivanov
    Admin
    Martin Ivanov avatar
    1408 posts

    Posted 23 Jun Link to this post

    Hello Ryan,

    I checked your code but I cannot tell what happens. Can you try your approach with the TrackBallSyncedCharts SDK and see if the issue still appears? If so, can you post some runnable code that demonstrates the reported behavior?

    You can use the approach from the ChartsWithSamePlotAreaSize tab in the SDK example.

    Regards,
    Martin Ivanov
    Progress Telerik
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Back to Top