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

PieSeries tooltip customization

2 Answers 90 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Eyal Ellenbogen
Top achievements
Rank 1
Eyal Ellenbogen asked on 18 Sep 2012, 09:07 AM
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 Answers, 1 is accepted

Sort by
0
Accepted
Petar Kirov
Telerik team
answered on 20 Sep 2012, 05:27 PM
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.

0
Eyal Ellenbogen
Top achievements
Rank 1
answered on 03 Dec 2012, 09:05 AM
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.
Tags
Chart
Asked by
Eyal Ellenbogen
Top achievements
Rank 1
Answers by
Petar Kirov
Telerik team
Eyal Ellenbogen
Top achievements
Rank 1
Share this question
or