How to use JFreeChart in Servlet

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

How to use JFreeChart in Servlet

Post by vikas » Mon Jun 06, 2005 2:16 pm

Up to now I have used JFreeChart with Swing and applet
now I want to use it in servlet
but in servlet there in no Panel , so how to display it ?

Stacey
Posts: 15
Joined: Tue Jan 27, 2004 5:09 pm

Post by Stacey » Mon Jun 06, 2005 2:22 pm

The ChartUtilities class has a bunch of utility methods to encode the chart into an OutputStream (your HTTPServletResponse outputStream).

angel
Posts: 899
Joined: Thu Jan 15, 2004 12:07 am
Location: Germany - Palatinate

Post by angel » Mon Jun 06, 2005 2:24 pm

One important method is the ServletUtilities.saveChartAsPNG. There a some threads about this in the forum. Just search.

Guest

Post by Guest » Mon Jun 06, 2005 2:32 pm

angel wrote:One important method is the ServletUtilities.saveChartAsPNG. There a some threads about this in the forum. Just search.
I know that we can save chart in jpeg or png format
but i want display chart on servlet or jsp page

Guest

Post by Guest » Mon Jun 06, 2005 4:49 pm

on the jsp page call the servlet that draws the chart using img tag

<IMG src="../path/to/servletchart"/>

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 » Mon Jun 06, 2005 10:07 pm

There is a chapter in the JFreeChart Developer Guide that describes how to use JFreeChart with Tomcat. You can also take a look at Richard Atkinson's demo:

http://www.jfree.org/phpBB2/viewtopic.php?t=5513
David Gilbert
JFreeChart Project Leader

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

Locked