Class JFreeChartDemoBase

java.lang.Object
org.jfree.chart.demo.JFreeChartDemoBase

public class JFreeChartDemoBase
extends Object
A simple class that allows the swing and servlet chart demonstrations to share chart generating code. If you would like to add a chart to the swing and/or servlet demo do so here.
  • Field Details

    • CHART_COMMANDS

      public static final 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 String BASE_RESOURCE_CLASS
      Base class name for localised resources.
      See Also:
      Constant Field Values
  • Constructor Details

    • JFreeChartDemoBase

      public JFreeChartDemoBase()
      Default constructor.
  • Method Details

    • getChart

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

      public 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.
    • createPieChartThree

      public JFreeChart createPieChartThree()
      Creates and returns a sample pie chart which compares 2 datasets.
      Returns:
      a sample pie chart.
      Since:
      0.9.18
    • 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.

      Note: with the introduction of multiple secondary datasets in JFreeChart version 0.9.10, the overlaid chart facility has been removed. You can achieve the same results using a regular XYPlot with multiple datasets.

      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.

      Note: from version 0.9.10, the overlaid chart is no longer supported (you can achieve the same result using a regular XYPlot with multiple datasets and renderers).

      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.
    • createWaferMapChart

      public JFreeChart createWaferMapChart()
      Creates a basic wafermap chart with a random dataset
      Returns:
      a wafermap chart
    • createWaferMapChartValueIndexed

      public JFreeChart createWaferMapChartValueIndexed()
      Creates a basic wafermap chart with a random dataset
      Returns:
      a wafermap chart
    • createWaferMapChartPositionIndexed

      public JFreeChart createWaferMapChartPositionIndexed()
      Creates a basic wafermap chart with a random dataset
      Returns:
      a wafermap chart