I use writeChartAsJPEG(java.io.OutputStream out,
JFreeChart chart,
int width,
int height)
to write the chart onto a output stream.
I wonder what the int width, and height stand for, do they define the size of the image of the chart, and are they in pixels?
thanks
chart size params
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
If you follow through the source code, you'll see that the 'height' and 'width' are ultimately used in this method (belonging to the JFreeChart class):
So it controls the width and height of the image.
Code: Select all
public BufferedImage createBufferedImage(int width, int height, ChartRenderingInfo info) {
BufferedImage image = new BufferedImage(width , height, BufferedImage.TYPE_INT_RGB);
Graphics2D g2 = image.createGraphics();
draw(g2, new Rectangle2D.Double(0, 0, width, height), info);
g2.dispose();
return image;
}
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
What values did you use for the width and height, and what is the size of the image (in pixels) generated by JFreeChart?
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader

