How to control the plot area width?

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

How to control the plot area width?

Post by reji » Thu Jan 23, 2003 8:34 am

Hi,

How to control the width of the plot area of a chart..? I am having two charts in this screen

[ http://www.rejimani.com/images/chart_align.gif ]. '

Connected sessions' is TimeSeries chart and 'Tablespace I/O' is bar chart. I would like to align the Y-axis of both the charts in same position... Is there any way to do this..?

thanks,

reji

David Gilbert

Re: How to control the plot area width?

Post by David Gilbert » Fri Jan 24, 2003 11:01 am

Hi Reji,

Unfortunately the dynamic layout used by JFreeChart, which is intended to make charts look reasonable at all kinds of different sizes, means that you can never know in advance what the relative proportions of the axis, plot and other chart components will be. This does cause a problem when you want to align more than one chart.

There is a method setFixedDimension(...) in the axis class, that is used by the combined plots to ensure that all axes in a combined plot have the same height (or width). But that first requires working out the maximum axis width for all the subplots. Perhaps you can use this fixed dimension to resolve your problem, but I'm not sure how you will work out the axis width in advance.

Regards,

Dave Gilbert

Locked