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

ChartToolTipBehavior, ChartTrackBallBehavior

5 Answers 408 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Timo
Top achievements
Rank 1
Timo asked on 08 Dec 2011, 12:05 PM
  1. How does ChartToolTipBehavior work? I cannot manage to make it work.
  2. 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

Sort by
0
Giuseppe
Telerik team
answered on 12 Dec 2011, 04:01 PM
Hi Timo,

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

0
Timo
Top achievements
Rank 1
answered on 04 Jan 2012, 03:38 PM
Thanks for the provided information.

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.
0
Giuseppe
Telerik team
answered on 09 Jan 2012, 03:04 PM
Hello Timo,

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

0
Shilpa
Top achievements
Rank 1
answered on 15 Jun 2016, 08:33 AM

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

0
Dinko | Tech Support Engineer
Telerik team
answered on 16 Jun 2016, 01:54 PM
Hello 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
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
ChartView
Asked by
Timo
Top achievements
Rank 1
Answers by
Giuseppe
Telerik team
Timo
Top achievements
Rank 1
Shilpa
Top achievements
Rank 1
Dinko | Tech Support Engineer
Telerik team
Share this question
or