print() in ChartPanel invokes JFreeChart's
draw(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D chartArea, java.awt.geom.Point2D anchor, ChartRenderingInfo info)
So if the chartAreas differ much from each other in printer context and screen context, the chart printed out might look not like the one on screen...
Better solution?
Regards,
enrico
Problem with ChartPanel's print
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
You could modiy the code to draw the chart at the same size as the panel, then scale it to fit the area on the page.
There are so many different ways that the print option could be implemented, I just chose one simple way. Feel free to change it.
There are so many different ways that the print option could be implemented, I just chose one simple way. Feel free to change it.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader

