Generate graph with no border/bground

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

Generate graph with no border/bground

Post by Badri » Tue Jan 28, 2003 11:34 pm

I use JfreeChart to generate JPEG images of a linechart. I got rid of the X and Y- axes by using setVisible(false) of Axis class. Despite that, saved JPEG shows a border and outside the border a thin strip of whatever color I set as backgroundpaint, on all the four sides of the image. Can any one help me to get rid of the border and the background color from the saved image? Setting the background color to white wouldn't work, because I've to place another static image before this generated image so that static image + gen image looks like a single image. So I can't have the gap or a border. TIA.

David Gilbert

Re: Generate graph with no border/bground

Post by David Gilbert » Wed Jan 29, 2003 12:08 am

You should modify the insets for the plot using the setInsets(...) method in the Plot class. And perhaps also use setOutlineStroke(null)...

Regards,

Dave Gilbert

Badri

Re: Generate graph with no border/bground

Post by Badri » Wed Jan 29, 2003 12:24 am

Thanks Dave. It works.

// For those who might be interested
Insets ins = new Insets(0,0,0,0);
plot.setInsets(ins);
plot.setOutlineStroke(null);

Locked