on a doughnut, how do i selectively show the format?

3 posts, 1 answers
  1. Jingying
    Jingying avatar
    19 posts
    Member since:
    May 2009

    Posted 01 Jul 2009 Link to this post

    Currently i have

     

    doughnutSeries.Definition =

     

    new DoughnutSeriesDefinition();

     

    ((

     

    DoughnutSeriesDefinition)doughnutSeries.Definition).LabelOffset = 0.7d;

     

    doughnutSeries.Definition.DefaultFormat =

     

    "#%{p0}";

    And when i have 0%, the slices are just a line and the text looks messy.
    Is there a way, not to show the 0% when it's 0%?

    here's how it looks like now : http://tinyimages.us/show.php/16601_doughnut.JPG.html

     

     

  2. Answer
    Ves
    Admin
    Ves avatar
    2926 posts

    Posted 06 Jul 2009 Link to this post

    Hello Jingying,

    You can loop through all the items and remove the label:

    foreach (var item in RadChart1.DefaultView.ChartArea.DataSeries[0]) 
            { 
                if (item.YValue == 0) 
                    item.Label = " "
            } 

    Note, that the label is set to a string containing a white space as the default value of string.Empty is the default one and RadChart puts the calculated label according to the default label format

    Kind regards,
    Ves
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Jingying
    Jingying avatar
    19 posts
    Member since:
    May 2009

    Posted 16 Jul 2009 Link to this post

    that works. thanks again
Back to Top