com.jrefinery.chart.demo
Class JFreeChartDemoBase

java.lang.Object
  |
  +--com.jrefinery.chart.demo.JFreeChartDemoBase

public class JFreeChartDemoBase
extends java.lang.Object

A simple class that allows the swing and servlet chart demostrations to share chart generating code. If you would like to add a chart to the swing and/or servlet demo do so here.

Author:
BRS/DG

Field Summary
static java.lang.String BASE_RESOURCE_CLASS
          Base class name for localised resources.
static java.lang.String[][] CHART_COMMANDS
          CHART_COMMANDS holds information on charts that can be created Format is Name, Creation Method, Resource file prefix Steps To add a chart 1) Create a createChart method which returns a JFreeChart 2) Append details to CHART_COMMANDS 3) Append details to DemoResources
 
Constructor Summary
JFreeChartDemoBase()
          Default constructor.
 
Method Summary
 JFreeChart createCandlestickChart()
          Creates a candlestick chart.
 JFreeChart createCombinedAndOverlaidChart1()
          Creates a combined and overlaid chart.
 JFreeChart createCombinedAndOverlaidDynamicXYChart()
          Displays an XY chart that is periodically updated by a background thread.
 JFreeChart createCompassChart()
          Creates a compass chart.
 JFreeChart createDynamicXYChart()
          Displays an XY chart that is periodically updated by a background thread.
 JFreeChart createGanttChart()
          Creates a gantt chart.
 JFreeChart createHighLowChart()
          Displays a vertical bar chart in its own frame.
 JFreeChart createHorizontalBarChart()
          Create a horizontal bar chart.
 JFreeChart createHorizontallyCombinedChart()
          Creates a horizontally combined chart.
 JFreeChart createLineChart()
          Creates and returns a sample line chart.
 JFreeChart createMeterChartChord()
          Creates and returns a sample meter chart.
 JFreeChart createMeterChartCircle()
          Creates and returns a sample meter chart.
 JFreeChart createMeterChartPie()
          Creates and returns a sample meter chart.
 JFreeChart createNullXYPlot()
          Creates and returns a sample XY chart with null data.
 JFreeChart createOverlaidChart()
          Creates and returns a sample overlaid chart.
 JFreeChart createPieChartOne()
          Creates and returns a sample pie chart.
 JFreeChart createPieChartTwo()
          Creates and returns a sample pie chart.
 JFreeChart createScatterPlot()
          Creates and returns a sample scatter plot.
 JFreeChart createSignalChart()
          Creates and returns a sample signal chart.
 JFreeChart createSingleSeriesBarChart()
          Creates and returns a sample bar chart with just one series.
 JFreeChart createStackedHorizontalBarChart()
          Creates and returns a sample stacked horizontal bar chart.
 JFreeChart createThermometerChart()
          Creates and returns a sample thermometer chart.
 JFreeChart createTimeSeries1Chart()
          Creates and returns a sample time series chart.
 JFreeChart createTimeSeries2Chart()
          Creates and returns a sample time series chart.
 JFreeChart createTimeSeriesChartInScrollPane()
          Creates and returns a sample time series chart that will be displayed in a scroll pane.
 JFreeChart createTimeSeriesWithMAChart()
          Creates and returns a sample time series chart.
 JFreeChart createVertical3DBarChart()
          Creates and returns a sample vertical 3D bar chart.
 JFreeChart createVerticalBarChart()
          Creates and returns a sample vertical bar chart.
 JFreeChart createVerticallyCombinedChart()
          Creates and returns a sample vertically combined chart.
 JFreeChart createVerticalStacked3DBarChart()
          Creates and returns a sample stacked vertical 3D bar chart.
 JFreeChart createVerticalStackedBarChart()
          Creates and returns a sample stacked vertical bar chart.
 JFreeChart createVerticalXYBarChart()
          Creates and returns a sample vertical XY bar chart.
 JFreeChart createWindPlot()
          Creates and returns a sample wind plot.
 JFreeChart createXYPlot()
          Creates and returns a sample XY plot.
 JFreeChart createXYPlotZeroData()
          Creates a sample XY plot with an empty dataset.
 JFreeChart getChart(int i)
          Returns a chart.
 java.util.ResourceBundle getResources()
          This makes the resources bundle available.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CHART_COMMANDS

public static final java.lang.String[][] CHART_COMMANDS
CHART_COMMANDS holds information on charts that can be created Format is Name, Creation Method, Resource file prefix Steps To add a chart 1) Create a createChart method which returns a JFreeChart 2) Append details to CHART_COMMANDS 3) Append details to DemoResources

BASE_RESOURCE_CLASS

public static final java.lang.String BASE_RESOURCE_CLASS
Base class name for localised resources.
Constructor Detail

JFreeChartDemoBase

public JFreeChartDemoBase()
Default constructor.
Method Detail

getChart

public JFreeChart getChart(int i)
Returns a chart.
Parameters:
i - the chart index.
Returns:
a chart.

getResources

public java.util.ResourceBundle getResources()
This makes the resources bundle available. Basically an optimisation so the demo servlet can access the same resource file.
Returns:
the resources bundle.

createHorizontalBarChart

public JFreeChart createHorizontalBarChart()
Create a horizontal bar chart.
Returns:
a horizontal bar chart.

createStackedHorizontalBarChart

public JFreeChart createStackedHorizontalBarChart()
Creates and returns a sample stacked horizontal bar chart.
Returns:
a sample stacked horizontal bar chart.

createVerticalBarChart

public JFreeChart createVerticalBarChart()
Creates and returns a sample vertical bar chart.
Returns:
a sample vertical bar chart.

createVertical3DBarChart

public JFreeChart createVertical3DBarChart()
Creates and returns a sample vertical 3D bar chart.
Returns:
a sample vertical 3D bar chart.

createVerticalStackedBarChart

public JFreeChart createVerticalStackedBarChart()
Creates and returns a sample stacked vertical bar chart.
Returns:
a sample stacked vertical bar chart.

createVerticalStacked3DBarChart

public JFreeChart createVerticalStacked3DBarChart()
Creates and returns a sample stacked vertical 3D bar chart.
Returns:
a sample stacked vertical 3D bar chart.

createPieChartOne

public JFreeChart createPieChartOne()
Creates and returns a sample pie chart.
Returns:
a sample pie chart.

createPieChartTwo

public JFreeChart createPieChartTwo()
Creates and returns a sample pie chart.
Returns:
a sample pie chart.

createXYPlot

public JFreeChart createXYPlot()
Creates and returns a sample XY plot.
Returns:
a sample XY plot.

createTimeSeries1Chart

public JFreeChart createTimeSeries1Chart()
Creates and returns a sample time series chart.
Returns:
a sample time series chart.

createTimeSeries2Chart

public JFreeChart createTimeSeries2Chart()
Creates and returns a sample time series chart.
Returns:
a sample time series chart.

createTimeSeriesWithMAChart

public JFreeChart createTimeSeriesWithMAChart()
Creates and returns a sample time series chart.
Returns:
a sample time series chart.

createHighLowChart

public JFreeChart createHighLowChart()
Displays a vertical bar chart in its own frame.
Returns:
a high low chart.

createCandlestickChart

public JFreeChart createCandlestickChart()
Creates a candlestick chart.
Returns:
a candlestick chart.

createSignalChart

public JFreeChart createSignalChart()
Creates and returns a sample signal chart.
Returns:
a sample chart.

createThermometerChart

public JFreeChart createThermometerChart()
Creates and returns a sample thermometer chart.
Returns:
a sample thermometer chart.

createMeterChartCircle

public JFreeChart createMeterChartCircle()
Creates and returns a sample meter chart.
Returns:
a meter chart.

createMeterChartPie

public JFreeChart createMeterChartPie()
Creates and returns a sample meter chart.
Returns:
a meter chart.

createMeterChartChord

public JFreeChart createMeterChartChord()
Creates and returns a sample meter chart.
Returns:
the meter chart.

createCompassChart

public JFreeChart createCompassChart()
Creates a compass chart.
Returns:
a compass chart.

createWindPlot

public JFreeChart createWindPlot()
Creates and returns a sample wind plot.
Returns:
a sample wind plot.

createScatterPlot

public JFreeChart createScatterPlot()
Creates and returns a sample scatter plot.
Returns:
a sample scatter plot.

createLineChart

public JFreeChart createLineChart()
Creates and returns a sample line chart.
Returns:
a line chart.

createVerticalXYBarChart

public JFreeChart createVerticalXYBarChart()
Creates and returns a sample vertical XY bar chart.
Returns:
a sample vertical XY bar chart.

createNullXYPlot

public JFreeChart createNullXYPlot()
Creates and returns a sample XY chart with null data.
Returns:
a chart.

createXYPlotZeroData

public JFreeChart createXYPlotZeroData()
Creates a sample XY plot with an empty dataset.
Returns:
a sample XY plot with an empty dataset.

createTimeSeriesChartInScrollPane

public JFreeChart createTimeSeriesChartInScrollPane()
Creates and returns a sample time series chart that will be displayed in a scroll pane.
Returns:
a sample time series chart.

createSingleSeriesBarChart

public JFreeChart createSingleSeriesBarChart()
Creates and returns a sample bar chart with just one series.
Returns:
a sample bar chart.

createDynamicXYChart

public JFreeChart createDynamicXYChart()
Displays an XY chart that is periodically updated by a background thread. This is to demonstrate the event notification system that automatically updates charts as required.
Returns:
a chart.

createOverlaidChart

public JFreeChart createOverlaidChart()
Creates and returns a sample overlaid chart.
Returns:
an overlaid chart.

createHorizontallyCombinedChart

public JFreeChart createHorizontallyCombinedChart()
Creates a horizontally combined chart.
Returns:
a horizontally combined chart.

createVerticallyCombinedChart

public JFreeChart createVerticallyCombinedChart()
Creates and returns a sample vertically combined chart.
Returns:
a sample vertically combined chart.

createCombinedAndOverlaidChart1

public JFreeChart createCombinedAndOverlaidChart1()
Creates a combined and overlaid chart.
Returns:
a combined and overlaid chart.

createCombinedAndOverlaidDynamicXYChart

public JFreeChart createCombinedAndOverlaidDynamicXYChart()
Displays an XY chart that is periodically updated by a background thread. This is to demonstrate the event notification system that automatically updates charts as required.
Returns:
a chart.

createGanttChart

public JFreeChart createGanttChart()
Creates a gantt chart.
Returns:
a gantt chart.