Is there a way to eliminate top whitespace

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

Is there a way to eliminate top whitespace

Post by Kenny Dubuisson » Wed Dec 04, 2002 9:39 pm

I'm creating charts via servlets that generate them as a JPEG. When my image is created, there is a significant amount of whitespace in the image above the chart title (about 50 pixels). Is there any way to eliminate this or reduce it? I'm trying to get 3 charts on a printed web page and the 3 areas of whitespace add up to forcing me to reduce the size of my charts. Thanks,
Kenny

David Gilbert

Re: Is there a way to eliminate top whitespace

Post by David Gilbert » Wed Dec 04, 2002 11:59 pm

Hi Kenny,

That sounds like more white space than I'd expect. Can you send me an example? The setSpacer(...) method in the AbstractTitle class will control how much space is reserved around the outside of each title.

Assuming your title is at the top of the chart, that is the first thing drawn, so there shouldn't be any other white space appearing.

One other cause is if you set the title to an empty string, it will still reserve space as if there was some text there...better to use null in that case, although it doesn't sound like this is your problem.

Regards,

DG

Locked