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
Size of Graph
RE: Size of Graph
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.
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.
RE: Size of Graph
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
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
RE: Size of Graph
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.
Regards,
DG.