Size of Graph

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

Size of Graph

Post by Rawat Subodh Kumar » Thu Aug 17, 2000 9:43 am

Hi,

I generating a servlet by using JFreeChart. Everything is ok except this: if I include three series in a line graph, it generates java.IOException : too many colors for GIF. If I reduce the size of graph from 600X400 to 600X200 then it is working. The setting for anti-aliasing is also true.

Kindly help me on this.

Thanks.

Rawat

David Gilbert

RE: Size of Graph

Post by David Gilbert » Thu Aug 17, 2000 9:26 pm

Hi Rawat,

I think the anti-aliasing may generate a lot of different shades of whatever colors appear in your chart. A GIF format image can only have 256 colors, so this may be causing your problem.

If you can, use PNG or JPEG format for your images. There's another post on this forum about an open-source PNG encoder, with some sample code.

If you really want GIF format images, then try setting anti-aliasing to false.

Regards,

DG.

Rawat Subodh Kumar

RE: Size of Graph

Post by Rawat Subodh Kumar » Fri Aug 18, 2000 2:13 am

Hi David,

Thanks a lot for your kind help. Now the graph is comming perfectly after making anti-aliasing false. Another problem is related to JFreeChart is , If I print the graph by using browser print command only blank page is printing. I am using HP Laster printer (Black). Do I need to upgrade GAR file for JFreeChart?

Please help me on this issue.

Thanks.

Rawat

David Gilbert

RE: Size of Graph

Post by David Gilbert » Fri Aug 18, 2000 6:31 am

Once you have JFreeChart into a GIF file and displayed in your browser, I think any printing problems must be beyond JFreeChart. It would have to be the browser, your printer driver, or the GIF encoding, I think...

Regards,

DG.

Locked