Server generated GIF/PNG charts
Server generated GIF/PNG charts
Can I use JFreeChart for the generation of charts as GIF/PNG files on a SUN server running Sybase ASE/EAS? My application does not allow for any client side Java, so I have to generate the complete chart as GIF/PNG and send it to the client's browser.
RE: Server generated GIF/PNG charts
You can certainly generate GIF and PNG image files with JFreeChart - there's some sample code elsewhere in this forum for generating PNG files (you should be able to find it with a search). I've also added the code to the source in CVS on SourceForge (http://sourceforge.net/projects/jfreechart) so you could check it out of there if you want to.
One issue that has been reported - in the current JDK, Java2D (which JFreeChart uses) relies on having X running on your server. Some of the Java2D methods are passed on to native X functions, I guess. So if you don't have X running, you will have a problem running JFreeChart.
Regards,
DG.
One issue that has been reported - in the current JDK, Java2D (which JFreeChart uses) relies on having X running on your server. Some of the Java2D methods are passed on to native X functions, I guess. So if you don't have X running, you will have a problem running JFreeChart.
Regards,
DG.
RE: Server generated GIF/PNG charts
I´m also interested in generating server-side jpegs or gifs, but I don´t know where this application will be hosted. What if the server is running on a WinNT server? Does the server need anything special besides the ¨usual¨ (JRE, servlet engine, etc)?
Thanks,
Daniel Serodio
Thanks,
Daniel Serodio
RE: Server generated GIF/PNG charts
I don't think you have the same issue with NT, since the native graphics functions that Java2D relies on are part of the operating system - they'll always be available, no matter what your server configuration.
Regards,
DG.
Regards,
DG.
RE: Server generated GIF/PNG charts
If you are using some Unix-system to host your server and it doesn't have an X-window sysyem runnig, there's still a workaround. There are plenty of virtual x-window systems available that cheat Java code (though not only Java
. Try the search in Google, don't remember the links, but read a lot about it.
Hope this helps a bit to clear out the issue

Hope this helps a bit to clear out the issue

RE: Server generated GIF/PNG charts
You can try xvfb (X virtual Frame buffer) to simulate an X installation for a headless system.
On the other hand you an also try JDK1.4 where they have an in built support for Virtual Frame buffers.
On the other hand you an also try JDK1.4 where they have an in built support for Virtual Frame buffers.
RE: Server generated GIF/PNG charts
By used writeChartAsJPEG method in ChartUtilites class.
If I login to console of my UNIX system (Redhat Linux 7.2),
compiled the *.java file with the DISPLAY=:0.0. Then I have
no problem to dump the JFreeChart to JPEG.
But If I login to my system by telnet,
compiled the *.java file with DISPLAY=myhost:0.0
Then I got error message "can't connect to X11 server with DISPLAY
myhost:0.0
If I login to console of my UNIX system (Redhat Linux 7.2),
compiled the *.java file with the DISPLAY=:0.0. Then I have
no problem to dump the JFreeChart to JPEG.
But If I login to my system by telnet,
compiled the *.java file with DISPLAY=myhost:0.0
Then I got error message "can't connect to X11 server with DISPLAY
myhost:0.0