Can I get the appropriate Height and Width which chart need,

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

Can I get the appropriate Height and Width which chart need,

Post by Mikio Kishi » Mon Aug 12, 2002 7:18 am

Hi,

Now, I use excellent JFreeChart with Java Servlet, and
I have one question about JFreeChart.

Question:
Although it is necessary to specify "Height" and "Width"
when outputting JPEG and PNG image using JFreeChart
(ChartUtilities.writeChartAsJPEG() etc..),
are there any methods which can get these "appropriate"
sizes of Height and Width ,automatically ?

The reason is that the more number of series and
category is increasing , the harder We view the outputed image
if this image size is fixing.

Regards,

Mikio Kishi

David Gilbert

Re: Can I get the appropriate Height and Width which chart n

Post by David Gilbert » Mon Aug 12, 2002 9:44 am

By design, JFreeChart doesn't have a preferred height or width for charts. It just tries to do the best it can with the space allocated to it. Most of the time this works well, but it isn't perfect.

You might be able to devise a simple calculation to determine the chart size based on the number of series/categories, and put that in your servlet code.

Regards,

DG.

Mikio Kishi

Re: Can I get the appropriate Height and Width which chart n

Post by Mikio Kishi » Mon Aug 12, 2002 10:11 am

Thank you for your rapid response.

I will try to devise such a calculation based on the number of series/categories.

Mikio Kishi

Locked