Y Axis label insets

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

Y Axis label insets

Post by Richard Mok » Mon May 27, 2002 9:49 am

Hi,

Would be appreciated if someone can give me direction on the following question:

How can I use reserveWidth() method? what shoud I pass in for the Graphics2D parameter?

I have a jsp which contains 5 500x250pixel time series images which are generated by a servlet. For some chart, the y-axis value ranges from 0-30 while some may be 0-25000. This makes the charts plot area don't align with each others. Knowing that I can use
VerticalNumberAxis.setLabelInsets() to adjust the chart margin, how I need to caluculate the width of the insets using

VerticalNumberAxis.reserveWidth(java.awt.Graphics2D g2, Plot plot, java.awt.geom.Rectangle2D drawArea)

Thanks in advance for you help..

Richard

David Gilbert

Re: Y Axis label insets

Post by David Gilbert » Mon May 27, 2002 11:25 pm

Hi Richard,

The reserveWidth method is designed to be called by the JFreeChart object once drawing has started (in which case the Graphics2D is available). I'm not sure what you should use in your JSP.

If you look through the code in CVS for CombinedXYPlot, you will see that it has a mechanism for working out the maximum axis width then setting this for all the subplots. I guess a generalisation of this is required for a CombinedCharts class with a list of sub charts. I'll add it to the to-do list...

Regards,

DG.

Locked