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

RadCartesianChart ToolTip

1 Answer 134 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Levon
Top achievements
Rank 1
Levon asked on 25 Jun 2013, 09:28 PM
I have a RadCartesianChart and two series in it - BarSeries and LineSeries.
My LineSeries have only two points. the first point of my BarSeries and the last one of it. It shows the average value of the BarSeries-so it is a straight line. I want to have tooltip on the whole line.Currently I have only on the points of my LineSeries. Is it possible to see the tooltip everywhere I hover the line?

1 Answer, 1 is accepted

Sort by
0
Rosko
Telerik team
answered on 28 Jun 2013, 04:25 PM
Hi Levon,

For your scenario, it is better to use the Annotations feature of RadCartesianChart. You can check the corresponding online demo with source code and online help topic.

Also, for you scenario specifically, you can check the following code snippet which demonstrates two possible approaches. You just need to copy-paste into a project to see the result.
<telerik:RadCartesianChart x:Name="chart" IsHitTestVisible="True">
            <telerik:RadCartesianChart.HorizontalAxis>
                <telerik:CategoricalAxis x:Name="horizontalAxis"/>
            </telerik:RadCartesianChart.HorizontalAxis>
            <telerik:RadCartesianChart.VerticalAxis>
                <telerik:LinearAxis x:Name="verticalAxis"/>
            </telerik:RadCartesianChart.VerticalAxis>
            <telerik:RadCartesianChart.Series>
                <telerik:BarSeries>
                    <telerik:BarSeries.DataPoints>
                        <telerik:CategoricalDataPoint Category="1" Value="1"/>
                        <telerik:CategoricalDataPoint Category="2" Value="2"/>
                        <telerik:CategoricalDataPoint Category="3" Value="3"/>
                        <telerik:CategoricalDataPoint Category="4" Value="4"/>
                        <telerik:CategoricalDataPoint Category="5" Value="5"/>
                        <telerik:CategoricalDataPoint Category="6" Value="6"/>
                    </telerik:BarSeries.DataPoints>
                </telerik:BarSeries>
            </telerik:RadCartesianChart.Series>
            <telerik:RadCartesianChart.Behaviors>
                <telerik:ChartTooltipBehavior/>
            </telerik:RadCartesianChart.Behaviors>
            <telerik:RadCartesianChart.Annotations>
                <telerik:CartesianGridLineAnnotation x:Name="gridLineAnnotation"
                                                     Axis="{Binding ElementName=verticalAxis}"
                                                     Value="4.5"
                                                     StrokeThickness="3"
                                                     Stroke="Green"
                                                     Label="Average value: 4.5"
                                                     IsHitTestVisible="True"
                                                     telerik:RadToolTipService.ToolTipContent="Average value: 4.5"
                                                     telerik:RadToolTipService.PlacementTarget="{Binding ElementName=chart}">
                                                      
                </telerik:CartesianGridLineAnnotation>
                <telerik:CartesianCustomLineAnnotation x:Name="customLineAnnotation"
                                                       VerticalFrom="2.5" VerticalTo="2.5"
                                                       HorizontalFrom="1" HorizontalTo="6"
                                                       StrokeThickness="3"
                                                       Stroke="Red"
                                                       IsHitTestVisible="True"
                                                       telerik:RadToolTipService.ToolTipContent="Average value: 3.5"
                                                       telerik:RadToolTipService.PlacementTarget="{Binding ElementName=chart}"/>
            </telerik:RadCartesianChart.Annotations>
        </telerik:RadCartesianChart>



Regards,
Rosko
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
Chart
Asked by
Levon
Top achievements
Rank 1
Answers by
Rosko
Telerik team
Share this question
or