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

[Solved] RadPie and RadCartesian charts inside GridView

4 Answers 136 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.
Igor
Top achievements
Rank 1
Igor asked on 04 Sep 2012, 12:47 PM
I have a couple of RadPieCharts and RadCartesianCharts, each inside it's own GridViewItem. There are some other things in the item so I put it all inside a Grid. (so: GridView -> GridViewItem -> Grid -> chart)

Problem is in higher resolutions in which I start getting more height available than the width I allow the item to take.

Now, the RadPieChart resizes and positions itself in the center of the grid leaving a lot of space on the top and bottom. If I try setting the VerticalAlignment property, it goes to the top but gets completely cut off and small. So I left it that way - in the center.

One of the GridViewItems has a RadCartesianChart inside a Grid, too. The problem is - it takes up the whole height, and it's ugly. If I try to set the maximum height, then it stays at that maximum height, but it goes on the top of the Grid. If I try setting vertical alignment, it also becomes extremely small (low height) and doesn't size well. If I try setting the fixed height and vertical alignment, it still doesn't go to the vertical center of the grid. I tried margins, vertical content alignment etc. but nothing seems to work.

It's now very ugly because the RadPieChart positioned itself in the vertical center and RadCartesianChart in the vertical top. Any advice on how to fix this?

4 Answers, 1 is accepted

Sort by
0
Tsvyatko
Telerik team
answered on 06 Sep 2012, 04:06 PM
Hi Igor,

 Thank you for feedback regarding this behavior. We have found similar problems when using controls (including charts within Row/column definitions with size Auto). Currently we are still investigating this behavior in order to came up with solution for it. As a workaround you can use star of fixed size grid columns. As a point of reference you can check chart first look example in our demo app.

Greetings,
Tsvyatko
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Igor
Top achievements
Rank 1
answered on 17 Sep 2012, 08:37 AM
Hello Tsvyatko



I have tried setting the VerticalAlignment again after the update to release candidate, but there are no changes.



Do you have any information about it being supported in future updates?
0
Georgi
Telerik team
answered on 19 Sep 2012, 02:17 PM
Hi Igor,

Please accept my apologies for the delayed answer and thanks for bringing our attention to this problem.

We are currently looking into this behavior and trying to find an appropriate solution to it. I will contact you back when we have an answer.

Kind regards,
Georgi
the Telerik team

Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

0
Georgi
Telerik team
answered on 19 Sep 2012, 04:38 PM
Hi Igor,

I played with the scenario you describe - placing a chart within a grid and controlling its position through the Horizontal and Vertical Alignment properties. Please find attached the sample project I am testing with.

I will try to describe the Grid sizing behavior regarding the different Alignment options. When the Stretch option is used then the Control takes the available width/height. In all other cases the Control will take its Desired Width. Since the Chart does not have a desired size, it will return its Minimum size, which is 100*100 units.

If you want to align the Chart horizontally Left, Right or Center then you have to specify its width. If you want to align the Chart vertically Top, Bottom or Center then you have to specify its height. The Pie Chart is a special case because its ellipse always takes as a diameter the smaller of its Width and Height and is placed in the center of the bounding box.

Let me know whether this explanation helps and makes sense to you.

Greetings,
Georgi
the Telerik team

Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

Tags
Chart for XAML
Asked by
Igor
Top achievements
Rank 1
Answers by
Tsvyatko
Telerik team
Igor
Top achievements
Rank 1
Georgi
Telerik team
Share this question
or