Display figures as % in pie chart

4 posts, 0 answers
  1. Stuart
    Stuart avatar
    30 posts
    Member since:
    Jun 2010

    Posted 15 Sep 2010 Link to this post

    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
  2. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 15 Sep 2010 Link to this post

    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
  3. Stuart
    Stuart avatar
    30 posts
    Member since:
    Jun 2010

    Posted 15 Sep 2010 Link to this post

    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
  4. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 20 Sep 2010 Link to this post

    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
Back to Top