Page 1 of 1

How to return one PNG object from a JFreeChart

Posted: Thu Mar 19, 2009 9:59 am
by Chaniat
Hello

I am using JFreeChart 1.1.11.

I would like include this java library into a web application (Servlet Bean and JSP)

Inside one bean, I would like write one getxxxx method, with the followed parameters
imput parameter: JFreeChart object
Output parameter: JPEG or PNG object

How can I.

Could you help me

Thank in advance

Re: How to return one PNG object from a JFreeChart

Posted: Sun Mar 22, 2009 4:42 pm
by vbossica
Something like the following should do the trick:

Code: Select all

    import org.jfree.chart.ChartUtilities;

    ChartUtilities.writeChartAsPNG(response.getOutputStream(), chart, width, height)