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

Hiding datapoint with zero values in stack bar

1 Answer 135 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Gautam
Top achievements
Rank 1
Gautam asked on 23 Dec 2010, 12:41 PM
I have requirement where I need to show stack bar chart with more than one legend and each legend having multiple datapoints. When I have a datapoint with value 0, it is also displayed in the stack bar label. Is it possible to hide the specific label in the bar?

Please help!

1 Answer, 1 is accepted

Sort by
0
Giuseppe
Telerik team
answered on 23 Dec 2010, 01:19 PM
Hello Gautam,

You can set the StackedBarSeriesDefinition.LabelSettings.ShowZeroValueLabels to false:

DataSeries series = new DataSeries();
var definition = new StackedBarSeriesDefinition();
definition.LabelSettings.ShowZeroValueLabels = false;
series.Definition = definition;
 
series.Add(new DataPoint(10));
series.Add(new DataPoint(0));
series.Add(new DataPoint(20));
 
DataSeries series2 = new DataSeries();
var definition2 = new StackedBarSeriesDefinition();
definition2.LabelSettings.ShowZeroValueLabels = false;
series2.Definition = definition2;
series2.Add(new DataPoint(10));
series2.Add(new DataPoint(50));
series2.Add(new DataPoint(20));
 
RadChart1.DefaultView.ChartArea.DataSeries.Add(series);
RadChart1.DefaultView.ChartArea.DataSeries.Add(series2);

Hope this helps.


Best wishes,
Freddie
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
Tags
Chart
Asked by
Gautam
Top achievements
Rank 1
Answers by
Giuseppe
Telerik team
Share this question
or