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

ItemFormatLabel for pie charts

1 Answer 60 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Adam Petaccia
Top achievements
Rank 1
Adam Petaccia asked on 17 Aug 2010, 07:58 PM
I'd like my pie charts to display the percentage of the pie as the label, and the actual number as the tooltip. Unfortunately, i can't seem to figure out how to get the percentage into the label. #STPERCENT just seems to return the YValue.

1 Answer, 1 is accepted

Sort by
0
Accepted
Giuseppe
Telerik team
answered on 18 Aug 2010, 03:30 PM
Hi Adam Petaccia,

You can achieve the desired formatting like this:

RadChart1.DefaultSeriesDefinition = new PieSeriesDefinition() { ItemLabelFormat = "#%{p2}", ShowItemToolTips = true };
RadChart1.ItemsSource = new int[] {1,2,3,10,20, 50 };

Hope this helps.


Sincerely yours,
Freddie
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
Tags
Chart
Asked by
Adam Petaccia
Top achievements
Rank 1
Answers by
Giuseppe
Telerik team
Share this question
or