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

Show Tool tip on Bar Series on position of mouse pointer/Tap

2 Answers 38 Views
Chart for XAML
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Ahmed
Top achievements
Rank 1
Ahmed asked on 12 Jan 2014, 02:42 PM
I am new in Rad Charts, and want to show the tool tip of bar series of the chart exactly on the position of the mouse pointer when it hovers across/tap any data point of bar series, and to show its data such as the value of this data point. I don't want to show the tool tip on top of it like this page explains http://www.telerik.com/help/windows-8-xaml/radchart-behaviors-charttooltipbehavior.html
Please try to give an example of how to implement this in XAML using RadCartesianChart & BarSeries.

2 Answers, 1 is accepted

Sort by
0
Accepted
Ivaylo Gergov
Telerik team
answered on 14 Jan 2014, 10:18 AM
Hello Ahmed,

You can specify the placement of the ToolTip through the ChartTooltipBehavior.SnapToClosestPoint property. In your scenario, you should change it to False. Here is the code of a working scenario:
<Chart:RadCartesianChart>
    <Chart:RadCartesianChart.HorizontalAxis>
        <Chart:CategoricalAxis/>
    </Chart:RadCartesianChart.HorizontalAxis>
    <Chart:RadCartesianChart.VerticalAxis>
        <Chart:LinearAxis/>
    </Chart:RadCartesianChart.VerticalAxis>
    <Chart:RadCartesianChart.Behaviors>
        <Chart:ChartTooltipBehavior SnapToClosestPoint="False" />
    </Chart:RadCartesianChart.Behaviors>
    <Chart:BarSeries>
        <Chart:BarSeries.DataPoints>
            <charting:CategoricalDataPoint Category="first" Value="10"/>
            <charting:CategoricalDataPoint Category="second" Value="15"/>
            <charting:CategoricalDataPoint Category="third" Value="22"/>
        </Chart:BarSeries.DataPoints>
    </Chart:BarSeries>
</Chart:RadCartesianChart>

Where xmlns:Chart="using:Telerik.UI.Xaml.Controls.Chart" and  xmlns:charting="using:Telerik.Charting".

I hope this helps. Let me know should you need further assistance.
 

Regards,
Ivaylo Gergov
Telerik

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Ahmed
Top achievements
Rank 1
answered on 14 Jan 2014, 04:09 PM
Thanks so much Ivaylo.
This is the right and simplest answer and SnapToClosestPoint="False" 
is the property that I was looking for.
Tags
Chart for XAML
Asked by
Ahmed
Top achievements
Rank 1
Answers by
Ivaylo Gergov
Telerik team
Ahmed
Top achievements
Rank 1
Share this question
or