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

[Solved] Looking for clarity on pie chart sizing and legends

2 Answers 174 Views
Chart for XAML
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Mikhail
Top achievements
Rank 1
Mikhail asked on 15 Jul 2012, 01:48 PM
Hello,

Forgive me if these are naive questions, I've only started working with telerik controls with the new beta. I'm just using pie charts for now.

Firstly - I'm trying to find the API for rendering chart legends and can't find it. The docs for the silverlight equivalents didn't help.

Secondly, I'm struggling to figure out how to properly size a chart. I've found two imperfect solutions: Changing the radiusfactor property enlarges the chart but then causes it to get clipped within its parent if it goes over 1. Changing the height of the radpiechart element also works, but results in the loss of resolution-independence. What I would like to do is set the chart's horizontalalignment to stretch so it fills its parent, and to use that in combination with margins to control its size. However, the horizontalalignment property seems to be ignored.

Finally, the chart's container seems to be ignoring the labels when sizing itself, so it results in clipped labels if they're at the top or bottom of the chart. How can I change this?

Many thanks,
Mike

2 Answers, 1 is accepted

Sort by
0
Accepted
Georgi
Telerik team
answered on 16 Jul 2012, 11:14 AM
Hi Mike,

Thank you very much for using RadControls for Metro.

We have uploaded a compiled (.chm) version of our documentation and it is available for download from your Telerik account. The docs are still incomplete and we are working hard to add the missing parts and we will re-upload the package when it is ready. We are also planning to make the documentation available online by the end of the week.

The Chart control generally does not have a Desired Size - it takes the available size of its parent container. The Chart itself has a Minimum size and will return this size if asked to measure itself with (Infinity, Infinity) - which is the case if the control resides within a StackPanel. The better option is to put the control within a Grid container with relatively sized Rows/Colums.

Could you please prepare a simple project that demonstrates what your scenario is so that I can take a look and help you with some real code?

I am looking forward to your reply.

Greetings,
Georgi
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Mikhail
Top achievements
Rank 1
answered on 16 Jul 2012, 01:32 PM
Ahh sorry - you're right and this was my mistake. I had a complicated layout and somehow overlooked that the direct parent of the chart was a stackpanel with its different sizing rules. Once I changed it to a grid everything worked fine.
Tags
Chart for XAML
Asked by
Mikhail
Top achievements
Rank 1
Answers by
Georgi
Telerik team
Mikhail
Top achievements
Rank 1
Share this question
or