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

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

2 Answers 40 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Jingying
Top achievements
Rank 1
Jingying asked on 02 Jul 2009, 02:40 AM

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 Answers, 1 is accepted

Sort by
0
Accepted
Ves
Telerik team
answered on 06 Jul 2009, 07:18 AM
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.
0
Jingying
Top achievements
Rank 1
answered on 16 Jul 2009, 07:16 PM
that works. thanks again
Tags
Chart
Asked by
Jingying
Top achievements
Rank 1
Answers by
Ves
Telerik team
Jingying
Top achievements
Rank 1
Share this question
or