com.jrefinery.chart.demo
Class JFreeChartServletDemo

java.lang.Object
  |
  +--javax.servlet.GenericServlet
        |
        +--javax.servlet.http.HttpServlet
              |
              +--com.jrefinery.chart.demo.JFreeChartServletDemo
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class JFreeChartServletDemo
extends javax.servlet.http.HttpServlet

A servlet demonstration, contributed by Wolfgang Irler.

Author:
WI
See Also:
Serialized Form

Constructor Summary
JFreeChartServletDemo()
           
 
Method Summary
 CategoryDataset createCategoryDataset()
          Creates and returns a sample category dataset for the demo charts.
protected  JFreeChart createChart(int type, int initGradColor, int finalGradColor)
          Returns a chart.
 HighLowDataset createHighLowDataset()
          Creates and returns a sample high-low dataset for the demo.
 XYDataset createTestXYDataset()
          Creates and returns a XYDataset for the demo charts.
 void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Basic servlet method, answers requests fromt the browser.
protected  java.awt.Color getColor(int color)
          Utility method to return a color.
 void init(javax.servlet.ServletConfig config)
          Override init() to set up data used by invocations of this 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

JFreeChartServletDemo

public JFreeChartServletDemo()
Method Detail

getColor

protected java.awt.Color getColor(int color)
Utility method to return a color. Corresponds to the color selection in the HTML form.
Parameters:
color - the color index.
Returns:
a color.

createCategoryDataset

public CategoryDataset createCategoryDataset()
Creates and returns a sample category dataset for the demo charts.
Returns:
a sample category dataset.

createTestXYDataset

public XYDataset createTestXYDataset()
Creates and returns a XYDataset for the demo charts.
Returns:
a sample XY dateset.

createHighLowDataset

public HighLowDataset createHighLowDataset()
Creates and returns a sample high-low dataset for the demo. Added by Andrzej Porebski.
Returns:
a sample high low dataset.

createChart

protected JFreeChart createChart(int type,
                                 int initGradColor,
                                 int finalGradColor)
Returns a chart.
Parameters:
type - the chart type.
initGradColor - the first color for the gradient.
finalGradColor - the final color for the gradient.
Returns:
the chart.

init

public void init(javax.servlet.ServletConfig config)
          throws javax.servlet.ServletException
Override init() to set up data used by invocations of this servlet.
Overrides:
init in class javax.servlet.GenericServlet
Parameters:
config - configuration info.
Throws:
javax.servlet.ServletException - if there is a problem.

doGet

public void doGet(javax.servlet.http.HttpServletRequest request,
                  javax.servlet.http.HttpServletResponse response)
           throws javax.servlet.ServletException,
                  java.io.IOException
Basic servlet method, answers requests fromt the browser.
Overrides:
doGet in class javax.servlet.http.HttpServlet
Parameters:
request - HTTPServletRequest
response - HTTPServletResponse
Throws:
javax.servlet.ServletException - if there is a servlet problem.
java.io.IOException - if there is an I/O problem.