I am having a hard time figuring out how to add labels into my pie chart. so far I have data bound using an example like so:
List<PieData> dataSource = new List<PieData>();
dataSource.Add(new PieData("hey", 13.4));
dataSource.Add(new PieData("heysda", 50));
pieChart1.Series[0].ValueBinding = new GenericDataPointBinding<PieData, double>() { ValueSelector = product => product.QuantitySold };
pieChart1.Series[0].ItemsSource = dataSource;
My piedata object contains a value and a name handle and I want to know what I need to do to get the pieChart to display the name handle as the legend
5 Answers, 1 is accepted
Thanks for writing.
RadChart currently does not support automatic legend generation. You need to declare the legend manually.
Thanks for the feedback, we will consider implementing a legend in a future release.
Write again if you have other questions.
Victor
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
You can show the labels on the Pie Series of RadChart by toggling the property, ShowLabels. You have four properties at your disposal. They are:
- LabelOffset
- LabelTemplate
- AngleRange
- ShowLabels
If you want to learn more on how to use the properties, this link will bring you the documentation for Pie Series.I hope this helps you nail down what you're looking to do.
Good Luck,
Lancelot
You can, for example, use an items control, that is bound to a list of different sample data points. This way you can use a custom ItemTemplate to visualize each unique data point. Also, since this component is not a part of RadChart you will have full control over its layout and position in relation to the chart.
I hope this suggestion was helpful.
Victor
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>