Problem with ChartPanel's print

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
enrico
Posts: 49
Joined: Thu Jul 22, 2004 7:13 pm
Location: Shaanxi, P.R.China

Problem with ChartPanel's print

Post by enrico » Sun Oct 24, 2004 4:53 pm

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

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Mon Oct 25, 2004 5:40 pm

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.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

Locked