Hi,
I have been reading the resources and forum posts but I can't seem to be able to bind a TextBlock in my TrackBallInfoTemplate to a field on the DataItem object.
The following is the TrackBallInfoTemplate:
The following is a definition of the class containing the data which is used to display the bar chart:
On the Bar Series definition in XAML the CategoryBinding is set to the "Category" field and the ValueBinding is set to "Value".
The graph displays but only the DataPoint.Value field is bound in the TrackBallInfo template. The other "Name" field does not appear.
According to the UI WPF API doc the "DataItem" field should contain "the original data item".
Ref:
http://www.telerik.com/help/wpf/p_telerik_windows_controls_charting_datapoint_dataitem.html
Am I missing something fundamental here? I am using Telerik.Windows.Controls.Chart version 2013.3.1204.40.
Thanks in advance,
Rob
I have been reading the resources and forum posts but I can't seem to be able to bind a TextBlock in my TrackBallInfoTemplate to a field on the DataItem object.
The following is the TrackBallInfoTemplate:
<chartView:BarSeries.TrackBallInfoTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding DataPoint.Value}" FontWeight="Bold" /> <TextBlock Text=":" FontWeight="Bold" /> <TextBlock Text="{Binding DataPoint.DataItem.Name}" FontWeight="Bold" /> </StackPanel> </DataTemplate> </chartView:BarSeries.TrackBallInfoTemplate>The following is a definition of the class containing the data which is used to display the bar chart:
public class CategoryData{ public string Name { get; set; } public double Value { get; set; } public string Category { get; set; }}On the Bar Series definition in XAML the CategoryBinding is set to the "Category" field and the ValueBinding is set to "Value".
The graph displays but only the DataPoint.Value field is bound in the TrackBallInfo template. The other "Name" field does not appear.
According to the UI WPF API doc the "DataItem" field should contain "the original data item".
Ref:
http://www.telerik.com/help/wpf/p_telerik_windows_controls_charting_datapoint_dataitem.html
Am I missing something fundamental here? I am using Telerik.Windows.Controls.Chart version 2013.3.1204.40.
Thanks in advance,
Rob