This question is locked. New answers and comments are not allowed.
Hi i used DoughnutSeries chart in my windows store app . problem is that when legend is 0 percent then label show 0%. i want to remove label definition for specific 0 percent data points. for better understanding i attach picture of chart. i want to handle 0 percent that is on right side of chart
thanks
thanks
3 Answers, 1 is accepted
0
Accepted
Hi,
In your scenario I can suggest that you change the ChartSeriesLabelDefinition.Template and use a ValueConvertor to skip a label which is 0%. Here's an example:
Where the Converter class looks like this:
I hope this helps.
Regards,
Ivaylo Gergov
Telerik
In your scenario I can suggest that you change the ChartSeriesLabelDefinition.Template and use a ValueConvertor to skip a label which is 0%. Here's an example:
<telerikChart:DoughnutSeries.LabelDefinitions> <telerikChart:ChartSeriesLabelDefinition> <telerikChart:ChartSeriesLabelDefinition.Template> <DataTemplate> <TextBlock Text="{Binding Converter={StaticResource converter}}"/> </DataTemplate> </telerikChart:ChartSeriesLabelDefinition.Template> </telerikChart:ChartSeriesLabelDefinition></telerikChart:DoughnutSeries.LabelDefinitions><Page.Resources> <local:Converter x:Key="converter"/></Page.Resources>Where the Converter class looks like this:
public class Converter : IValueConverter { public object Convert(object value, Type targetType, object parameter, string language) { var dataPoint = value as DoughnutDataPoint; var percent = dataPoint.Percent; if (percent == 0) { return ""; } else { return String.Format("{0}%",percent); } } public object ConvertBack(object value, Type targetType, object parameter, string language) { throw new NotImplementedException(); } }I hope this helps.
Regards,
Ivaylo Gergov
Telerik
Check out the new Telerik Platform - the only modular platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native apps. Register for the free online keynote and webinar to learn more about the Platform on Wednesday, February 12, 2014 at 11:00 a.m. ET (8:00 a.m. PT).
0
Zubair
Top achievements
Rank 1
answered on 04 Feb 2014, 04:05 PM
thanks for u r reply . Overlapping of labels hurt me more. have u any solution for this problem ? Check attach file thnks.
0
Hi,
Currently the RadChart does not support Smart Labels i.e. to automatically align labels so that each labeled value stands out clearly. I have logged this as a feature request in our Ideas and Feedback portal where you can vote for it and raise its priority.
Thank you for your valuable feedback.
Regards,
Ivaylo Gergov
Telerik
Currently the RadChart does not support Smart Labels i.e. to automatically align labels so that each labeled value stands out clearly. I have logged this as a feature request in our Ideas and Feedback portal where you can vote for it and raise its priority.
Thank you for your valuable feedback.
Regards,
Ivaylo Gergov
Telerik
Check out the new Telerik Platform - the only modular platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native apps. Register for the free online keynote and webinar to learn more about the Platform on Wednesday, February 12, 2014 at 11:00 a.m. ET (8:00 a.m. PT).