Problems resizing a chart

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Marcelo Medeiros

Problems resizing a chart

Post by Marcelo Medeiros » Tue Oct 22, 2002 4:50 pm

I´m having problems resizing a chart.
I´m using the method ChartPanel.setBounds but it is distorcing the chart.
How do I fix it?

thanks in advance

Marcelo

Dave Gilbert

Re: Problems resizing a chart

Post by Dave Gilbert » Tue Oct 22, 2002 4:54 pm

Hi Marcelo,

JFreeChart will draw a chart to fit any size ChartPanel. The size of the ChartPanel is determined by the layout manager as for any other Swing component. You shouldn't try to set the size of the panel yourself, always let the layout manager take care of it...

Regards,

DG.

Marcelo Medeiros

Re: Problems resizing a chart

Post by Marcelo Medeiros » Tue Oct 22, 2002 5:06 pm

But what is the difference between set the size of the panel or let layout
manager do it? Theoretically the behaviour of the chart must be the same,
right?
Is there a way to set the maximum height of the bars in the chart?

Thanks in advance. Best regards.

Marcelo

Locked