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

Hiding Zero Values in Pie Chart

1 Answer 55 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Saravanan Thiruchabai
Top achievements
Rank 1
Saravanan Thiruchabai asked on 26 Apr 2010, 04:20 AM
Hi

How to hide the zero values in a Pie Chart?

Thanks
Saran

1 Answer, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 28 Apr 2010, 11:34 AM
Hello Saravanan Thiruchabai,

Thank you for your interest in our controls.

In order to hide the labels of items with zero values, you can simply remove the DataPoints in the following manner :
RadChart1.ItemDataBound += new EventHandler<ChartItemDataBoundEventArgs>(RadChart1_ItemDataBound);
void RadChart1_ItemDataBound(object sender, ChartItemDataBoundEventArgs e)
       {
           if (e.DataPoint.YValue == 0)
               e.DataPoint.DataSeries.Remove(e.DataPoint);
       }

Alternatively, you may refer to the MeteoChart example, which uses a LabelVisibilityConverter class. Perhaps reviewing it would be helpful for you. Simply navigate to the Meteo Chart demo and press the View Code button to find the LabelVisibilityConverter.cs file.

Regards,
Nikolay
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
Saravanan Thiruchabai
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Share this question
or