Chart -> right click menu -> save as How to save as JP

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
bkieser
Posts: 9
Joined: Wed Jan 26, 2005 5:55 pm
Location: UK
Contact:

Chart -> right click menu -> save as How to save as JP

Post by bkieser » Thu Nov 10, 2005 5:11 pm

I know that programmatically we can save as JPG as well as PNG, but how to we enable this in the right-click menu (save as) option in chart? ATM it only allows for PNG.

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 » Thu Nov 10, 2005 5:21 pm

Are you sure you want JPEG? It is a horrible (lossy) format for charts.

If you really want it, you'll need to subclass ChartPanel, and override the createPopupMenu() and doSaveAs() methods. It's not that difficult, but still a little more involved than it should be (it would be nice to have ChartPanel support some kind of "plugin" for supported image formats).
David Gilbert
JFreeChart Project Leader

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

bkieser
Posts: 9
Joined: Wed Jan 26, 2005 5:55 pm
Location: UK
Contact:

Post by bkieser » Thu Nov 10, 2005 5:36 pm

Thanks Dave. I personally would hate to not use PNG but the concern raised by the testers is that M$ is very bad at supporting PNG.

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 » Thu Nov 10, 2005 5:44 pm

It is a long time since I used Internet Explorer, but if I recall the main problem is that it doesn't fully support transparency in PNG files. You can probably avoid that issue with your charts.
David Gilbert
JFreeChart Project Leader

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

Locked