- How does ChartToolTipBehavior work? I cannot manage to make it work.
- Is there an option for ChartTrackBallBehavior that if SnapMode = TrackBallSnapMode.None the IntersectionPoints will be drawn not over DataPoints but over the real intersection between series and TrackBallLine?
5 Answers, 1 is accepted
Generally you should start by adding the ChartToolTipBehavior to the RadCartesianChart.Behaviors collection.
If you are visualizing BarSeries, you will be able to see the default tooltip template instantly. However, if you are using LineSeries, you will need to define manually data template for the point marks via LineSeries.PointTemplate property (tooltips are supported only for the pointmarks at the moment):
<
telerik:RadCartesianChart
x:Name
=
"RadChart1"
>
<
telerik:RadCartesianChart.Behaviors
>
<
telerik:ChartTooltipBehavior
/>
<
telerik:ChartTrackBallBehavior
SnapMode
=
"None"
ShowIntersectionPoints
=
"True"
/>
</
telerik:RadCartesianChart.Behaviors
>
<
telerik:LineSeries
>
<
telerik:LineSeries.PointTemplate
>
<
DataTemplate
>
<
Ellipse
Height
=
"10"
Width
=
"10"
Stroke
=
"Black"
Fill
=
"White"
/>
</
DataTemplate
>
</
telerik:LineSeries.PointTemplate
>
<
telerik:CategoricalDataPoint
Value
=
"21"
Category
=
"Test 1"
/>
<
telerik:CategoricalDataPoint
Value
=
"30"
Category
=
"Test 2"
/>
<
telerik:CategoricalDataPoint
Value
=
"40"
Category
=
"Test 3"
/>
<
telerik:CategoricalDataPoint
Value
=
"21"
Category
=
"Test 4"
/>
<
telerik:CategoricalDataPoint
Value
=
"30"
Category
=
"Test 5"
/>
<
telerik:CategoricalDataPoint
Value
=
"40"
Category
=
"Test 6"
/>
</
telerik:LineSeries
>
<
telerik:RadCartesianChart.HorizontalAxis
>
<
telerik:CategoricalAxis
/>
</
telerik:RadCartesianChart.HorizontalAxis
>
<
telerik:RadCartesianChart.VerticalAxis
>
<
telerik:LinearAxis
/>
</
telerik:RadCartesianChart.VerticalAxis
>
</
telerik:RadCartesianChart
>
Also, if you are not satisfied with the default tooltip template, you can change it via RadCartesianChart.TooltipTemplate property like this:
<
telerik:RadCartesianChart
x:Name
=
"RadChart1"
>
<
telerik:RadCartesianChart.Behaviors
>
<
telerik:ChartTooltipBehavior
/>
<
telerik:ChartTrackBallBehavior
SnapMode
=
"None"
ShowIntersectionPoints
=
"True"
/>
</
telerik:RadCartesianChart.Behaviors
>
<
telerik:RadCartesianChart.TooltipTemplate
>
<
DataTemplate
>
<
Border
Background
=
"White"
BorderBrush
=
"Black"
BorderThickness
=
"1"
Padding
=
"5"
CornerRadius
=
"3"
>
<
TextBlock
Text
=
"{Binding Value}"
/>
</
Border
>
</
DataTemplate
>
</
telerik:RadCartesianChart.TooltipTemplate
>
<
telerik:LineSeries
>
<
telerik:LineSeries.PointTemplate
>
<
DataTemplate
>
<
Ellipse
Height
=
"10"
Width
=
"10"
Stroke
=
"Black"
Fill
=
"White"
/>
</
DataTemplate
>
</
telerik:LineSeries.PointTemplate
>
<
telerik:CategoricalDataPoint
Value
=
"21"
Category
=
"Test 1"
/>
<
telerik:CategoricalDataPoint
Value
=
"30"
Category
=
"Test 2"
/>
<
telerik:CategoricalDataPoint
Value
=
"40"
Category
=
"Test 3"
/>
<
telerik:CategoricalDataPoint
Value
=
"21"
Category
=
"Test 4"
/>
<
telerik:CategoricalDataPoint
Value
=
"30"
Category
=
"Test 5"
/>
<
telerik:CategoricalDataPoint
Value
=
"40"
Category
=
"Test 6"
/>
</
telerik:LineSeries
>
<
telerik:RadCartesianChart.HorizontalAxis
>
<
telerik:CategoricalAxis
/>
</
telerik:RadCartesianChart.HorizontalAxis
>
<
telerik:RadCartesianChart.VerticalAxis
>
<
telerik:LinearAxis
/>
</
telerik:RadCartesianChart.VerticalAxis
>
</
telerik:RadCartesianChart
>
As for ChartTrackBall behavior -- currently this functionality is not supported but we have logged it in our public issue tracking system and we will forward it to our developers for further consideration (besides visually drawing over the real intersection, we should consider calculating and visualizing the real intersection value in the control itself).
Best wishes,
Giuseppe
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Still, if zoom and tooltip behaviors are used and user zooms with mouse by selecting and area or by moving the zoombar slider (the width or height of zoombar slider must be changed and then moved in one direction), the tooltip will not appear even if there exists PointTemplate. If user zooms back to original size, the tooltip will appear.
Indeed we must admit we were able to reproduce the problematic behavior in our local tests as well.
We have logged this issue in our public issue tracking system and will forward it to our developers for further review so they can address it for one of the next weekly internal builds.
Sorry for the temporary inconvenience. We have updated your Telerik points for the report as well.
Greetings,
Giuseppe
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Hi Giuseppe,
I am using ScatterLineSeries and I want to show tooltip on the points on Mouse hover. In order to show tooltip I used Point Template while styling the chart. Since I do not want to see the ellipse, I set the color to transparent. But I have a huge number of points in the series and the UI freezes for long time while rendering the Lines. Then I realized that PointTemplate is causing the freeze. I removed it and the chart is rendering very fast. But the tooltip is not shown anymore. Please help me how to show tooltip without using Point Template.
Thanks,
Shilpa
This question seems to be a duplicate of the one with you ask in the forum thread with ID number 1043573. We have already answered your question in the other support ticket. In order to avoid duplication, let's continue in the other thread.
Regards,
Dinko
Telerik