How to return one PNG object from a JFreeChart

A discussion forum for the Eastwood Chart Servlet.

How to return one PNG object from a JFreeChart

Postby Chaniat » Thu Mar 19, 2009 9:59 am

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
Chaniat
 
Posts: 3
Joined: Thu Mar 19, 2009 9:48 am

Re: How to return one PNG object from a JFreeChart

Postby vbossica » Sun Mar 22, 2009 4:42 pm

Something like the following should do the trick:
Code: Select all
    import org.jfree.chart.ChartUtilities;

    ChartUtilities.writeChartAsPNG(response.getOutputStream(), chart, width, height)
vbossica
 
Posts: 5
Joined: Sun Jun 29, 2008 10:26 pm


Return to Eastwood Chart Servlet

Who is online

Users browsing this forum: No registered users and 1 guest

cron