Page 1 of 1

Auto-resizing of chart

Posted: Fri Feb 24, 2006 12:03 am
by 9640166
Hi,

In the charting examples, the chart automatically resizes when the window is resized.

Is there some property of the chart I need to set to perform this behaviour. I can't see anywhere in the sample code how it's done.

Thanks.

Posted: Fri Feb 24, 2006 8:51 am
by narcis
Hi Agrilink,

To achieve that you need to set tChart's Dock property at design-time at the property editor or at run-time using:

Code: Select all

tChart1.Dock=DockStyle.Fill;

Posted: Sun Feb 26, 2006 9:07 pm
by 9640166
Hi Narcis,

Cheers, thanks for that.

Posted: Sun Feb 26, 2006 10:14 pm
by 9640166
Hi Narcis,

Putting the chart in a panel doesn't resize it when resizing the window.

I've seen in some of the samples, a chart is contained in a panel and still resizes itself.

I've duplicated some of the relevant property settings, but I still get the same problem.

I tried it with the sample app I sent you previously and the chart doesn't resize.

Any ideas?

Thanks.

Posted: Mon Feb 27, 2006 9:03 am
by narcis
Hi Agrilink,

If you use a chart in a panel you need to set DockStyle for the panel and the chart:

Code: Select all

this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tChart2.Dock = System.Windows.Forms.DockStyle.Fill;