PieSeries tooltip customization

3 posts, 1 answers
  1. Eyal Ellenbogen
    Eyal Ellenbogen avatar
    11 posts
    Member since:
    Jul 2009

    Posted 18 Sep 2012 Link to this post

    Hi,

    I'm trying to figure out where and how I can customize the tooltip on the pie series slices. I want to change the layout, the format of the string and the actual value binding of it. Can some one please provide a proper example for it?

    Thanks,
    Eyal

  2. Answer
    Petar Kirov
    Admin
    Petar Kirov avatar
    425 posts

    Posted 20 Sep 2012 Link to this post

    Hi Eyal,

    There are 2 approaches to customize the ItemToolTip. 

    The first one is, as demonstrated here, to use the ItemToolTipOpening event of the ChartArea and utilize its parameters.

    The second one is to set the SeriesItemTooltipStyle of your series definition.

    <telerik:PieSeriesDefinition>                       
        <telerik:PieSeriesDefinition.SeriesItemTooltipStyle>
            <Style TargetType="telerik:ItemToolTip2D">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate>
                            <TextBlock Text="{Binding}" />
    I hope this helps.
     
    All the best,
    Petar Kirov
    the Telerik team

    Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

  3. DevCraft banner
  4. Eyal Ellenbogen
    Eyal Ellenbogen avatar
    11 posts
    Member since:
    Jul 2009

    Posted 03 Dec 2012 Link to this post

    Hi,

    I don't really know where to use that code you gave me. My code looks like this: 
    <charting:Chart   Style="{StaticResource PieChartStyle}"  ....>
    <charting:PieSeries ItemsSource="{Binding Stats2}"     
    IndependentValueBinding="{Binding Title}"
    DependentValueBinding="{Binding NumValue}" >....

    Where exactly does that PieSeriesDefinition is located? I can't find it anywhere.

    Looks like I declared my chart in a different way. I'm not using the RadChart thing. Instead I use charting:Chart and bind all the data there. Is there a different approach?

    EDIT: I feel stupid. This is not even telerik code... just the toolkit :) Please ignore this post. got confused because I was using both on the same page.
Back to Top