org.jfree.eastwood
Class ChartServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.jfree.eastwood.ChartServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class ChartServlet
extends javax.servlet.http.HttpServlet

A servlet that returns a chart as a PNG image. The servlet is designed to accept arguments formatted according to the Google Chart API.

This servlet accepts the following init-params:

fontSize The font size in points to be used for all texts. Titles will be rendered with a slightly larger size if the title font size hasn't been specified explicitly in the URL. The default is 12.
fontResource Servlet context relative path to a TrueType font file containing the font which should be used to render texts. E.g.: /WEB-INF/arial.ttf
fontFile File system path to a TrueType font file containing the font which should be used to render texts.
font The name of the font to use, e.g. Arial, Verdana. This font must be available to the JVM.
maximumImageSize The maximum image size in pixels (width * height). The default value is 360,000.
The default font if none of the font related parameters has been specified is Dialog, 12pt.

See Also:
Serialized Form

Constructor Summary
ChartServlet()
          Default constructor.
 
Method Summary
 void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Process a GET request.
 void init(javax.servlet.ServletConfig config)
          Initialise the servlet.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChartServlet

public ChartServlet()
Default constructor.

Method Detail

init

public void init(javax.servlet.ServletConfig config)
          throws javax.servlet.ServletException
Initialise the servlet.

Specified by:
init in interface javax.servlet.Servlet
Overrides:
init in class javax.servlet.GenericServlet
Parameters:
config - the config.
Throws:
javax.servlet.ServletException

doGet

public void doGet(javax.servlet.http.HttpServletRequest request,
                  javax.servlet.http.HttpServletResponse response)
           throws javax.servlet.ServletException,
                  java.io.IOException
Process a GET request.

Overrides:
doGet in class javax.servlet.http.HttpServlet
Parameters:
request - the request.
response - the response.
Throws:
javax.servlet.ServletException - if there is a servlet related problem.
java.io.IOException - if there is an I/O problem.


Copyright © 2010. All Rights Reserved.