This is a migrated thread and some comments may be shown as answers.

chartview zooming with synced trackballs issue

1 Answer 98 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 20 Jun 2017, 07:34 PM

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

1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 23 Jun 2017, 11:39 AM
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.
Tags
ChartView
Asked by
Ryan
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Share this question
or