Border around a chart

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

Border around a chart

Post by Laurence Moroney » Tue Sep 24, 2002 5:44 pm

When I create charts within a servlet and pump them back as JPEGs, there is a single pixel border around the chart by default.

Is there any way to get rid of this?

:L

josh

Re: Border around a chart

Post by josh » Tue Sep 24, 2002 9:03 pm

chart.getXYPlot.setInsets(new Insets(0,0,0,0));

that might do it.

Laurence Moroney

Re: Border around a chart

Post by Laurence Moroney » Wed Sep 25, 2002 4:14 pm

1/4 of the way there -- it removed the 'right' hand border.

:-)

Any more ideas?

Thanks,
:L

David Gilbert

Re: Border around a chart

Post by David Gilbert » Thu Sep 26, 2002 9:33 am

Hi Laurence,

Can you e-mail me a copy of your image file, and I'll look into where the border comes from. It depends on whether or not you have titles, a legend, axes etc.

Regards,

DG

Laurence Moroney

Re: Border around a chart

Post by Laurence Moroney » Thu Sep 26, 2002 3:44 pm

Check out the article that I published -- that servlet produces them...

:L

Alan

Re: Border around a chart

Post by Alan » Thu Oct 17, 2002 7:21 pm

If not too late, this worked for me : tplot.setInsets(new Insets(-1, -1, -1, -1));

Somehow, the top border needs a -1, not 0.

Locked