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

Format multiple trackball entries in relation to each other

1 Answer 173 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Dom
Top achievements
Rank 1
Dom asked on 11 Sep 2019, 08:41 AM
01.
<telerik:RadCartesianChart Name="Chart" Grid.Row="1" >
02. 
03.            <telerik:RadCartesianChart.HorizontalAxis>
04.                <telerik:DateTimeContinuousAxis LabelFitMode="MultiLine" LabelFormat="dd-MMM-yy" SmartLabelsMode="SmartStep" Title="Date" />
05.            </telerik:RadCartesianChart.HorizontalAxis>
06.            <telerik:RadCartesianChart.VerticalAxis>
07.                <telerik:LinearAxis RangeExtendDirection="None" LabelFormat="N0" Title="VaR"/>
08.            </telerik:RadCartesianChart.VerticalAxis>
09. 
10.            <telerik:RadCartesianChart.Behaviors>
11.                <telerik:ChartTrackBallBehavior SnapMode="ClosestPoint" SnapSinglePointPerSeries="True"  >   
12.                </telerik:ChartTrackBallBehavior>      
13.            </telerik:RadCartesianChart.Behaviors>
14. 
15.            <telerik:RadCartesianChart.SeriesProvider  >
16.                <telerik:ChartSeriesProvider Source="{Binding Series}" >
17.                    <telerik:ChartSeriesProvider.SeriesDescriptors >
18. 
19.                        <telerik:CategoricalSeriesDescriptor CategoryPath="Mkt_Date" 
20.                                                        ValuePath="VaR" 
21.                                                        ItemsSourcePath="Items">
22. 
23.                            <telerik:CategoricalSeriesDescriptor.Style >
24.                                <Style TargetType="telerik:LineSeries" BasedOn="{StaticResource LineSeriesStyle}">
25.                                    <Setter Property="StrokeThickness" Value="4"></Setter>
26.                                    <Setter Property="Stroke" Value="{Binding Color}"></Setter>
27.                                                                         
28.                                    <Setter Property="TrackBallInfoTemplate" >
29.                                        <Setter.Value>
30.                                            <DataTemplate>
31.                                                <Border>
32.                                                    <StackPanel Orientation="Horizontal">
33.                                                        <Label Background="{Binding Path=DataPoint.Presenter.DataContext.Color}" Width="16" Margin="1"></Label>
34.                                                        <TextBlock Text="{Binding Path=DataPoint.Presenter.DataContext.Book}"></TextBlock>
35.                                                        <TextBlock Text=" "></TextBlock>
36.                                                        <TextBlock Text="{Binding Path=DataPoint.Value, StringFormat=N4}"></TextBlock>
37.                                                    </StackPanel>
38.                                                </Border>
39.                                            </DataTemplate>
40.                                        </Setter.Value>     
41.                                    </Setter>
42.                                     
43.                                </Style>
44.                            </telerik:CategoricalSeriesDescriptor.Style>
45.                        </telerik:CategoricalSeriesDescriptor>
46.                    </telerik:ChartSeriesProvider.SeriesDescriptors>
47.                </telerik:ChartSeriesProvider>
48.            </telerik:RadCartesianChart.SeriesProvider>
49.        </telerik:RadCartesianChart>

 

Hi,

I'm wondering is it possible to format each entry in a trackball in relation to one another? Currently I display 1 or more series in this chart view with the details of data points in each series shown using the trackball. Ideally i would like to display all the trackball information within a grid so each type of information for each data point can be aligned. 

e.g.

     |     Category       |       Value           |  

     +============+============+

     |  Datapoint1Cat  |  Datapoint1Val  |

     +============+============+
     |  Datapoint2Cat  |  Datapoint2Val  |

     +============+============+
     |  Datapoint3Cat  |  Datapoint3Val  |

etc....

Is this possible/

 Thanks!

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Martin Ivanov
Telerik team
answered on 12 Sep 2019, 08:55 AM

Hello Dom,

To achieve your requirement, you can add elements with fixed size in the TrackBallInfoTemplate. This way each entry will have the same size and they will align. If this doesn't work in your case, you can edit the ControlTemplate of the TrackBallInfoControl and add Grid or RadGridView in it. I've attached a small example showing this approach. I hope it helps.

Regards,
Martin Ivanov
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Chart
Asked by
Dom
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Share this question
or