ChartLegend Tooltip

2 posts, 0 answers
  1. Philip Ashworth
    Philip Ashworth avatar
    41 posts
    Member since:
    Dec 2009

    Posted 18 Feb 2010 Link to this post


    Is it possible to display a tooltip over a chart legend item?
    I have a max width on the chart legends, some of the long names are cut off. I wanted to provide a tooltip to display the full name, is it possible?

    Thanks Phil.
  2. Dwight
    Dwight avatar
    475 posts

    Posted 23 Feb 2010 Link to this post

    Hello Philip Ashworth,

    Currently you need to re-template the ChartLegendItem. Here is a sample style:
    <Style TargetType="telerikCharting:ChartLegendItem">
        <Setter Property="Foreground" Value="{StaticResource LegendForeground}" />
        <Setter Property="MarkerStrokeThickness" Value="{StaticResource LegendItemMarkerStrokeThickness}" />
        <Setter Property="Template" >
                <ControlTemplate TargetType="telerikCharting:ChartLegendItem">
                    <Grid HorizontalAlignment="Stretch" VerticalAlignment="Top" ToolTipService.ToolTip="{TemplateBinding Label}">
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition />
                        <Rectangle x:Name="PART_LegendItemMarker"
                                   StrokeThickness="{TemplateBinding MarkerStrokeThickness}"
                                   Style="{TemplateBinding ItemStyle}" />
                        <TextBlock Grid.Column="1"
                                   Foreground="{TemplateBinding Foreground}"
                                   Text="{TemplateBinding Label}" />

    Then set this style through the RadChart.DefaultView.ChartLegend.LegendItemStyle property.

    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top