Log In | Get Help   
Home My Page Projects Code Snippets Project Openings Accounting and Billing Portal
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files
[abportal] View of /src/main/java/eu/smartlm/abs/portal/graph/servlet/DrawPieChartServlet.java
[abportal] / src / main / java / eu / smartlm / abs / portal / graph / servlet / DrawPieChartServlet.java Repository:
ViewVC logotype

View of /src/main/java/eu/smartlm/abs/portal/graph/servlet/DrawPieChartServlet.java

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (download) (annotate)
Wed Jul 28 10:05:51 2010 UTC (13 years, 9 months ago) by dgarcia
File size: 976 byte(s)
First code commit
package eu.smartlm.abs.portal.graph.servlet;

import java.io.IOException;
import java.io.OutputStream;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.jfree.chart.ChartUtilities;
import org.jfree.chart.JFreeChart;

public class DrawPieChartServlet extends HttpServlet {
	private static final long serialVersionUID = 8800080257427786322L;
	private int width = 400;
	private int height = 400;

	public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
		HttpSession session = request.getSession();
		JFreeChart chart = (JFreeChart) session.getAttribute("graph");
		 
		 OutputStream out = response.getOutputStream(); 
		 response.setContentType("image/png");
		 ChartUtilities.writeChartAsPNG(out, chart, width, height);
		 out.close();
	 }
}

root@forge.cesga.es
ViewVC Help
Powered by ViewVC 1.0.0  

Powered By FusionForge