Generate graph with no border/bground
Generate graph with no border/bground
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.
Re: Generate graph with no border/bground
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
Regards,
Dave Gilbert
Re: Generate graph with no border/bground
Thanks Dave. It works.
// For those who might be interested
Insets ins = new Insets(0,0,0,0);
plot.setInsets(ins);
plot.setOutlineStroke(null);
// For those who might be interested
Insets ins = new Insets(0,0,0,0);
plot.setInsets(ins);
plot.setOutlineStroke(null);