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

Labels for pie charts

5 Answers 133 Views
Chart
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Russell
Top achievements
Rank 1
Russell asked on 06 Jul 2012, 06:58 PM








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

Sort by
0
Victor
Telerik team
answered on 09 Jul 2012, 07:57 AM
Hello Russell,

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.

Greetings,
Victor
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Russell
Top achievements
Rank 1
answered on 09 Jul 2012, 04:07 PM
Not a legend even.  I was wondering if you have a way to auto generate names of the items right next to the percentage being displayed?  otherwise how is anyone supposed to know what the slices mean.  surely their is a way to put labels on the slices
0
Lancelot
Top achievements
Rank 1
answered on 09 Jul 2012, 09:19 PM
Hi Russell,

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:

  1. LabelOffset
  2. LabelTemplate
  3. AngleRange
  4. 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
0
Russell
Top achievements
Rank 1
answered on 09 Jul 2012, 10:17 PM
Thanks I actually ended up getting it but decided at I really need is a legend.  Any help would be greatly appreciated.
0
Victor
Telerik team
answered on 12 Jul 2012, 12:13 PM
Hello Russel,

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.

Regards,
Victor
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
Chart
Asked by
Russell
Top achievements
Rank 1
Answers by
Victor
Telerik team
Russell
Top achievements
Rank 1
Lancelot
Top achievements
Rank 1
Share this question
or