Bad quality when printing chart... [URGENT]

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

Bad quality when printing chart... [URGENT]

Post by Yann » Wed Mar 12, 2003 5:07 pm

Hi everybody, excuse me for my bad english, i'm french ;-)

I'm using jfreechart to generate OverlaidBarChart in png and then include it in a pdf document with fop.
When i print the png file, result is rather bad : font, legend etc... are blur.
I tried removing the antialising, but this time all is pixelated...

However, when i try to print directly from demo by right clicking the chart, result is perfect but bigger than on the screen...
My code is the same that in the demo, so what is the problem ?

How can I increase quality to get a good result printing my chart ?
Is that due to compression ?
Can i decrease it ?

Thanks

David Gilbert

Re: Bad quality when printing chart... [URGENT]

Post by David Gilbert » Wed Mar 12, 2003 6:08 pm

Once you export to PNG, the chart is just a bitmap, so printing quality will only be as good as the resolution of the image. When you print directly from a ChartPanel, the Graphics2D drawing primitives are used, so you usually get the best resolution that the printer supports.

Regards,

Dave Gilbert

Bob Rivers

Workaround

Post by Bob Rivers » Thu Jul 24, 2003 10:21 pm

Hi,

I have the same problem, but I solved it creating large jpeg images and then showing it reduced.

Ex.:

Code: Select all

BufferedImage image = chart.createBufferedImage(500, 500);
<img src="image.jpg" width="250" height="250">
The only problem is that the final size of the file is bigger than the one created using the final size (250 x 250).

Bob

arnaud
Posts: 86
Joined: Wed Mar 19, 2003 2:59 pm
Location: Paris, France
Contact:

Post by arnaud » Fri Jul 25, 2003 2:02 pm

Hello,

Please have a look at the code I posted on that RFE : [ 777515 ] High resolution images saving.

Regards,
Arnaud

marc
Posts: 2
Joined: Tue Apr 22, 2003 9:17 am

Could not find RFE Code mentioned

Post by marc » Fri Apr 23, 2004 3:59 pm

Hi Arnaud,

is it possible for you to re-post the code you mentioned as a solution for high resolution image saving?

I could not find an RFE with this ID on sourceforge.

Regards,
Marc

RonanKER
Posts: 1
Joined: Tue May 30, 2006 1:39 pm

Post by RonanKER » Tue May 30, 2006 1:42 pm

found it...
project = JFreeChart
and Artifact ID = 777515

http://sourceforge.net/tracker/index.ph ... tid=315494

now just have to understand how to make it...

thanks arnaud

lucas luky
Posts: 14
Joined: Wed Sep 12, 2007 7:05 pm

Post by lucas luky » Wed Sep 12, 2007 7:43 pm

i'm having the same problem.

the only difference is that I'm creating a graph and passing the BufferedImage to JasperReports... the legends and title looks ugly and bluried. :(

done some search on this forum but couldnt get a solution...

lucas luky
Posts: 14
Joined: Wed Sep 12, 2007 7:05 pm

ilustration...

Post by lucas luky » Tue Sep 18, 2007 6:26 pm

Image

im not sure if its clear in the screenshot, but what i want to show is:

1- the image on PDF is bigger than the one generated directly via "ChartUtilities.saveChartAsJPEG"

2- the subtitles on image are more readable than on PDF

OBS: to generate the PDF I'm using JasperReports, setting the "java.awt.Image" with the same width/height as defined in the "chart.createBufferedImage".

lucas luky
Posts: 14
Joined: Wed Sep 12, 2007 7:05 pm

Post by lucas luky » Wed Sep 19, 2007 8:16 pm


Locked