This question is locked. New answers and comments are not allowed.
When users tap on a data point on a RangeBarSeries, I would like to get a reference to the bound object, so that I can trigger my custom logic (ex. take the user to the details page of this object).
By subscribing to the Tap event of the RadCartesianChart, I can detect when users tap on a range and get coordinates of the tap, but missing the part of how to get from the coordinates to the bound object.
Thanks
Alex.
private void HeartRateZoneChart_OnTap(object sender, GestureEventArgs e)
{
var chart = (RadCartesianChart)sender;
Debug.WriteLine("Tap");
Debug.WriteLine(e.GetPosition(HorizontalAxis));
}
<telerikChart:RadCartesianChart x:Name="HeartRateZoneChart" Tap="HeartRateZoneChart_OnTap">
.....
<telerikChart:RangeBarSeries CategoryBinding="Name"
Canvas.ZIndex="2"
HighBinding="High"
LowBinding="Low">
<telerikChart:RangeBarSeries.PointTemplate>
<DataTemplate>
<Grid Background="{StaticResource PhoneForegroundBrush}">
<Canvas VerticalAlignment="Top">
<TextBlock
Text="{Binding Path=High}"
Canvas.Left="10"
Canvas.Top="-28"
Foreground="{StaticResource AnnotationsPointForeground}"/>
</Canvas>
<Canvas VerticalAlignment="Bottom">
<TextBlock
Text="{Binding Path=Low}"
Canvas.Left="7"/>
</Canvas>
</Grid>
</DataTemplate>
</telerikChart:RangeBarSeries.PointTemplate>
</telerikChart:RangeBarSeries>
</telerikChart:RadCartesianChart>
</Grid>
By subscribing to the Tap event of the RadCartesianChart, I can detect when users tap on a range and get coordinates of the tap, but missing the part of how to get from the coordinates to the bound object.
Thanks
Alex.
private void HeartRateZoneChart_OnTap(object sender, GestureEventArgs e)
{
var chart = (RadCartesianChart)sender;
Debug.WriteLine("Tap");
Debug.WriteLine(e.GetPosition(HorizontalAxis));
}
<telerikChart:RadCartesianChart x:Name="HeartRateZoneChart" Tap="HeartRateZoneChart_OnTap">
.....
<telerikChart:RangeBarSeries CategoryBinding="Name"
Canvas.ZIndex="2"
HighBinding="High"
LowBinding="Low">
<telerikChart:RangeBarSeries.PointTemplate>
<DataTemplate>
<Grid Background="{StaticResource PhoneForegroundBrush}">
<Canvas VerticalAlignment="Top">
<TextBlock
Text="{Binding Path=High}"
Canvas.Left="10"
Canvas.Top="-28"
Foreground="{StaticResource AnnotationsPointForeground}"/>
</Canvas>
<Canvas VerticalAlignment="Bottom">
<TextBlock
Text="{Binding Path=Low}"
Canvas.Left="7"/>
</Canvas>
</Grid>
</DataTemplate>
</telerikChart:RangeBarSeries.PointTemplate>
</telerikChart:RangeBarSeries>
</telerikChart:RadCartesianChart>
</Grid>