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

Dynamically size Chart

2 Answers 108 Views
Chart (obsolete as of Q1 2013)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Ryan farquhar
Top achievements
Rank 1
Ryan farquhar asked on 20 Jun 2007, 06:29 PM
I have the Radchart placed inside a DockWindow. What I would like to do is have the chart auto-size to the size of the DockWindow, so when someone maximizes the application the chart gets resized with the DockWindow.

So I either need a function I can call that automatically sizes it or some way of getting the size of the DockWindow that it is inside.

Any help would be appreciated.

2 Answers, 1 is accepted

Sort by
0
Ryan farquhar
Top achievements
Rank 1
answered on 20 Jun 2007, 06:58 PM
Nevermind, got it. To dynamically resize the chart to the same size as the dockpanel, you just add the following to the dockingmanger resize function:

RadChart1.Height = DockPanel2.Height
RadChart1.Width = DockPanel2.Width

This works great. I also added that code to the Load Sub so it would size correctly when the app starts.

0
Dwight
Telerik team
answered on 21 Jun 2007, 12:08 PM
Hi Alicia,

I'm glad that you found your way though the problem.

Another solution I may suggest is using the code you already wrote in the Load method to resize the chart, and then anchoring it. This way the framework will resize the chart for you when needed and you won't need the code in the Resize method.

The code for the Load method is something like:
 
radChart1.Size = DockPanel2.Size; 
radChart1.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Right; 
 

 
Best wishes,
Evtim
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Chart (obsolete as of Q1 2013)
Asked by
Ryan farquhar
Top achievements
Rank 1
Answers by
Ryan farquhar
Top achievements
Rank 1
Dwight
Telerik team
Share this question
or