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

Display figures as % in pie chart

3 Answers 78 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Stuart
Top achievements
Rank 1
Stuart asked on 15 Sep 2010, 04:04 PM
Hi

I currently have a data series with figures in that I want to display in a pie chart but as their equivalent ratio as a % against the total. Do I have to work out these percentages as an extra property in my viewmodel or is there a way that the Telerik chart can work it out itself?

Thanks

3 Answers, 1 is accepted

Sort by
0
Giuseppe
Telerik team
answered on 15 Sep 2010, 05:23 PM
Hi Stuart,

You can achieve the desired effect by setting the SeriesDefinition.ItemLabelFormat property like this:

RadChart1.DefaultSeriesDefinition = new PieSeriesDefinition() { ItemLabelFormat = "#%{P2}" };
RadChart1.ItemsSource = new int[] { 1, 2, 5, 5, 2 };

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
0
Stuart
Top achievements
Rank 1
answered on 15 Sep 2010, 05:41 PM
Ah - definitely helps, thanks. However the numbers I'm feeding in are slightly bigger than your example and I'm getting error messages saying 'Value was either too large or too small for an Int32'. Is there any way to overcome this?

Thanks again
0
Giuseppe
Telerik team
answered on 20 Sep 2010, 11:41 AM
Hello Stuart,

Indeed we must admit there was a problem with handling big numbers in the latest official version of the control.

However, our developers have already managed to address the issue so you can download the weekly internal build from your Client.Net account to get the fixed version (the fix will also be included in the official service pack release scheduled for later this week).

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
Stuart
Top achievements
Rank 1
Answers by
Giuseppe
Telerik team
Stuart
Top achievements
Rank 1
Share this question
or