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

Resize chart inside docking panel

4 Answers 59 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Rory
Top achievements
Rank 1
Rory asked on 18 Jan 2012, 10:58 PM
Hi I have a Horizontal Bar Chart inside a docking panel.
I would like the height of the chart to get bigger as we get more items or as we resize the panel. The width works fine and adjusts its self depending on the width of the panel but the height is always the same height. Please Help. The only workaround I can think of is to count how many items are in the datasource for the xaxis and calculate a height but then it will remiain static as the panel is resized.
Thanks.

4 Answers, 1 is accepted

Sort by
0
Rahul
Top achievements
Rank 2
answered on 20 Jan 2012, 05:54 PM
Hi Rory,
 
          I also same issue when gridview is in tileview.
Its not taking height automatically.

Please refer below link which may help you.
http://www.telerik.com/community/forums/silverlight/tileview/scrolls-for-grid-inside-tileview.aspx


Thanks & Regards
Rahul
0
Accepted
Petar Marchev
Telerik team
answered on 23 Jan 2012, 02:37 PM
Hi Rory,

1. I would like the height of the chart to get bigger as we resize the panel
I have attached a small project that demonstrates that the chart is being resized accordingly in both directions. When I resize the window - both the width and height of the chart are changed correctly to fit the dock panel. May be you have set height somewhere in your code and this is why you get such results. 

2. I would like the height of the chart to get bigger as we get more items.
The only way to achieve this is manually - when the chart is populated to calculate the new desired size of the chart. There is no way for the chart to know what is the appropriate height for your items.

Regards,
Petar Marchev
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Rory
Top achievements
Rank 1
answered on 23 Jan 2012, 07:05 PM
Thanks Peter for the basic example. We unfortunately are unable to take this simplistic approach because we need the chart to be a bit more dynamic and grow in height with the number of axis items. We also need the RadDockingPanel to become scrollable when the chart grows too large which seems to be linked to why the chart doesn't resize. Without scrolling once the number of items increases too much the chart becomes squeezed inside the panel and unreadable. We are doing a simple calculation like so to set our height. 
Take Care.

double chartHeight = (list.Count * heightPerItem) + minChartHeight; 
ClaimChart.Height = chartHeight;
0
Petar Marchev
Telerik team
answered on 26 Jan 2012, 10:51 AM
Hello,

Have you tried to wrap the chart in a scroll viewer?

If you keep experiencing problems with this you can create a small project that demonstrates the issue and send us the code so that we can see how you have structured the elements and get back to you with our feedback based on the code.

Regards,
Petar Marchev
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Tags
Chart
Asked by
Rory
Top achievements
Rank 1
Answers by
Rahul
Top achievements
Rank 2
Petar Marchev
Telerik team
Rory
Top achievements
Rank 1
Share this question
or