com.jrefinery.chart
Class ChartFactory

java.lang.Object
  extended by com.jrefinery.chart.ChartFactory

public class ChartFactory
extends java.lang.Object

Factory class for creating ready-made charts.


Constructor Summary
ChartFactory()
           
 
Method Summary
static JFreeChart createAreaChart(java.lang.String title, java.lang.String categoryAxisLabel, java.lang.String valueAxisLabel, CategoryDataset data, boolean legend)
          Creates an area chart with default settings.
static JFreeChart createAreaXYChart(java.lang.String title, java.lang.String xAxisLabel, java.lang.String yAxisLabel, XYDataset data, boolean legend)
          Creates an XY area plot.
static JFreeChart createCandlestickChart(java.lang.String title, java.lang.String timeAxisLabel, java.lang.String valueAxisLabel, HighLowDataset data, boolean legend)
          Creates and returns a default instance of a candlesticks chart based on the specified dataset.
static JFreeChart createGanttChart(java.lang.String title, java.lang.String categoryAxisLabel, java.lang.String dateAxisLabel, MultiIntervalCategoryDataset data, boolean legend)
          Creates a Gantt chart with default settings.
static JFreeChart createHighLowChart(java.lang.String title, java.lang.String timeAxisLabel, java.lang.String valueAxisLabel, HighLowDataset data, boolean legend)
          Creates and returns a default instance of a high-low-open-close chart based on the specified dataset.
static JFreeChart createHorizontalBarChart(java.lang.String title, java.lang.String domainAxisLabel, java.lang.String rangeAxisLabel, CategoryDataset data, boolean legend)
          Creates a horizontal bar chart with default settings.
static JFreeChart createHorizontalBarChart3D(java.lang.String title, java.lang.String categoryAxisLabel, java.lang.String valueAxisLabel, CategoryDataset data, boolean legend)
          Creates a horizontal 3D-effect bar chart with default settings.
static JFreeChart createLineChart(java.lang.String title, java.lang.String categoryAxisLabel, java.lang.String valueAxisLabel, CategoryDataset data, boolean legend)
          Creates a line chart with default settings.
static JFreeChart createPieChart(java.lang.String title, PieDataset data, boolean legend)
          Creates a pie chart with default settings.
static JFreeChart createScatterPlot(java.lang.String title, java.lang.String xAxisLabel, java.lang.String yAxisLabel, XYDataset data, boolean legend)
          Creates a scatter plot with default settings.
static JFreeChart createSignalChart(java.lang.String title, java.lang.String timeAxisLabel, java.lang.String valueAxisLabel, SignalsDataset data, boolean legend)
          Creates and returns a default instance of a signal chart based on the specified dataset.
static JFreeChart createStackedHorizontalBarChart(java.lang.String title, java.lang.String domainAxisLabel, java.lang.String rangeAxisLabel, CategoryDataset data, boolean legend)
          Creates a stacked horizontal bar chart with default settings.
static JFreeChart createStackedVerticalBarChart(java.lang.String title, java.lang.String categoryAxisLabel, java.lang.String valueAxisLabel, CategoryDataset data, boolean legend)
          Creates a stacked vertical bar chart with default settings.
static JFreeChart createStackedVerticalBarChart3D(java.lang.String title, java.lang.String categoryAxisLabel, java.lang.String valueAxisLabel, CategoryDataset data, boolean legend)
          Creates a stacked vertical bar chart with default settings.
static JFreeChart createTimeSeriesChart(java.lang.String title, java.lang.String timeAxisLabel, java.lang.String valueAxisLabel, XYDataset data, boolean legend)
          Creates and returns a time series chart.
static JFreeChart createVerticalBarChart(java.lang.String title, java.lang.String categoryAxisLabel, java.lang.String valueAxisLabel, CategoryDataset data, boolean legend)
          Creates a vertical bar chart with default settings.
static JFreeChart createVerticalBarChart3D(java.lang.String title, java.lang.String categoryAxisLabel, java.lang.String valueAxisLabel, CategoryDataset data, boolean legend)
          Creates a vertical 3D-effect bar chart with default settings.
static JFreeChart createVerticalXYBarChart(java.lang.String title, java.lang.String xAxisLabel, java.lang.String yAxisLabel, IntervalXYDataset data, boolean legend)
          Creates and returns a default instance of a VerticalXYBarChart based on the specified dataset.
static JFreeChart createWindPlot(java.lang.String title, java.lang.String xAxisLabel, java.lang.String yAxisLabel, WindDataset data, boolean legend)
           
static JFreeChart createXYChart(java.lang.String title, java.lang.String xAxisLabel, java.lang.String yAxisLabel, XYDataset data, boolean legend)
          Creates an XY (line) plot with default settings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChartFactory

public ChartFactory()
Method Detail

createVerticalBarChart

public static JFreeChart createVerticalBarChart(java.lang.String title,
                                                java.lang.String categoryAxisLabel,
                                                java.lang.String valueAxisLabel,
                                                CategoryDataset data,
                                                boolean legend)
Creates a vertical bar chart with default settings.

Parameters:
title - The chart title.
categoryAxisLabel - The label for the category axis.
valueAxisLabel - The label for the value axis.
data - The dataset for the chart.
legend - A flag specifying whether or not a legend is required.

createVerticalBarChart3D

public static JFreeChart createVerticalBarChart3D(java.lang.String title,
                                                  java.lang.String categoryAxisLabel,
                                                  java.lang.String valueAxisLabel,
                                                  CategoryDataset data,
                                                  boolean legend)
Creates a vertical 3D-effect bar chart with default settings.

Added by Serge V. Grachov.

Parameters:
title - The chart title.
categoryAxisLabel - The label for the category axis.
valueAxisLabel - The label for the value axis.
data - The dataset for the chart.
legend - A flag specifying whether or not a legend is required.

createStackedVerticalBarChart

public static JFreeChart createStackedVerticalBarChart(java.lang.String title,
                                                       java.lang.String categoryAxisLabel,
                                                       java.lang.String valueAxisLabel,
                                                       CategoryDataset data,
                                                       boolean legend)
Creates a stacked vertical bar chart with default settings.

Parameters:
title - The chart title.
categoryAxisLabel - The label for the category axis.
valueAxisLabel - The label for the value axis.
data - The dataset for the chart.
legend - A flag specifying whether or not a legend is required.

createStackedVerticalBarChart3D

public static JFreeChart createStackedVerticalBarChart3D(java.lang.String title,
                                                         java.lang.String categoryAxisLabel,
                                                         java.lang.String valueAxisLabel,
                                                         CategoryDataset data,
                                                         boolean legend)
Creates a stacked vertical bar chart with default settings.

Parameters:
title - The chart title.
categoryAxisLabel - The label for the category axis.
valueAxisLabel - The label for the value axis.
data - The dataset for the chart.
legend - A flag specifying whether or not a legend is required.

createHorizontalBarChart

public static JFreeChart createHorizontalBarChart(java.lang.String title,
                                                  java.lang.String domainAxisLabel,
                                                  java.lang.String rangeAxisLabel,
                                                  CategoryDataset data,
                                                  boolean legend)
Creates a horizontal bar chart with default settings.

Parameters:
title - The chart title.
domainAxisLabel - The label for the category axis.
rangeAxisLabel - The label for the value axis.
data - The dataset for the chart.
legend - A flag specifying whether or not a legend is required.
Returns:
A horizontal bar chart.

createHorizontalBarChart3D

public static JFreeChart createHorizontalBarChart3D(java.lang.String title,
                                                    java.lang.String categoryAxisLabel,
                                                    java.lang.String valueAxisLabel,
                                                    CategoryDataset data,
                                                    boolean legend)
Creates a horizontal 3D-effect bar chart with default settings.

Parameters:
title - The chart title.
categoryAxisLabel - The label for the category axis.
valueAxisLabel - The label for the value axis.
data - The dataset for the chart.
legend - A flag specifying whether or not a legend is required.

createStackedHorizontalBarChart

public static JFreeChart createStackedHorizontalBarChart(java.lang.String title,
                                                         java.lang.String domainAxisLabel,
                                                         java.lang.String rangeAxisLabel,
                                                         CategoryDataset data,
                                                         boolean legend)
Creates a stacked horizontal bar chart with default settings.

Parameters:
title - The chart title.
domainAxisLabel - The label for the category axis.
rangeAxisLabel - The label for the value axis.
data - The dataset for the chart.
legend - A flag specifying whether or not a legend is required.
Returns:
A stacked horizontal bar chart.

createLineChart

public static JFreeChart createLineChart(java.lang.String title,
                                         java.lang.String categoryAxisLabel,
                                         java.lang.String valueAxisLabel,
                                         CategoryDataset data,
                                         boolean legend)
Creates a line chart with default settings.

Parameters:
title - The chart title.
categoryAxisLabel - The label for the category axis.
valueAxisLabel - The label for the value axis.
data - The dataset for the chart.
legend - A flag specifying whether or not a legend is required.

createAreaChart

public static JFreeChart createAreaChart(java.lang.String title,
                                         java.lang.String categoryAxisLabel,
                                         java.lang.String valueAxisLabel,
                                         CategoryDataset data,
                                         boolean legend)
Creates an area chart with default settings.

Parameters:
title - The chart title.
categoryAxisLabel - The label for the category axis.
valueAxisLabel - The label for the value axis.
data - The dataset for the chart.
legend - A flag specifying whether or not a legend is required.

createGanttChart

public static JFreeChart createGanttChart(java.lang.String title,
                                          java.lang.String categoryAxisLabel,
                                          java.lang.String dateAxisLabel,
                                          MultiIntervalCategoryDataset data,
                                          boolean legend)
Creates a Gantt chart with default settings.

Parameters:
title - The chart title.
categoryAxisLabel - The label for the category axis.
dateAxisLabel - The label for the date axis.
data - The dataset for the chart.
legend - A flag specifying whether or not a legend is required.

createPieChart

public static JFreeChart createPieChart(java.lang.String title,
                                        PieDataset data,
                                        boolean legend)
Creates a pie chart with default settings.

Parameters:
title - The chart title.
data - The dataset for the chart.
legend - A flag specifying whether or not a legend is required.

createXYChart

public static JFreeChart createXYChart(java.lang.String title,
                                       java.lang.String xAxisLabel,
                                       java.lang.String yAxisLabel,
                                       XYDataset data,
                                       boolean legend)
Creates an XY (line) plot with default settings.

Parameters:
title - The chart title.
xAxisLabel - A label for the X-axis.
yAxisLabel - A label for the Y-axis.
data - The dataset for the chart.
legend - A flag specifying whether or not a legend is required.

createAreaXYChart

public static JFreeChart createAreaXYChart(java.lang.String title,
                                           java.lang.String xAxisLabel,
                                           java.lang.String yAxisLabel,
                                           XYDataset data,
                                           boolean legend)
Creates an XY area plot.

Parameters:
title - The chart title.
xAxisLabel - A label for the X-axis.
yAxisLabel - A label for the Y-axis.
data - The dataset for the chart.
legend - A flag specifying whether or not a legend is required.

createScatterPlot

public static JFreeChart createScatterPlot(java.lang.String title,
                                           java.lang.String xAxisLabel,
                                           java.lang.String yAxisLabel,
                                           XYDataset data,
                                           boolean legend)
Creates a scatter plot with default settings.

Parameters:
title - The chart title.
xAxisLabel - A label for the X-axis.
yAxisLabel - A label for the Y-axis.
data - The dataset for the chart.
legend - A flag specifying whether or not a legend is required.

createWindPlot

public static JFreeChart createWindPlot(java.lang.String title,
                                        java.lang.String xAxisLabel,
                                        java.lang.String yAxisLabel,
                                        WindDataset data,
                                        boolean legend)

createTimeSeriesChart

public static JFreeChart createTimeSeriesChart(java.lang.String title,
                                               java.lang.String timeAxisLabel,
                                               java.lang.String valueAxisLabel,
                                               XYDataset data,
                                               boolean legend)
Creates and returns a time series chart. A time series chart is an XYPlot with a date axis (horizontal) and a number axis (vertical), and each data item is connected with a line.

Note that you can supply a TimeSeriesDataset to this method as it is a subclass of XYDataset.

Parameters:
title - The chart title.
timeAxisLabel - A label for the time axis.
valueAxisLabel - A label for the value axis.
data - The dataset for the chart.
legend - A flag specifying whether or not a legend is required.

createVerticalXYBarChart

public static JFreeChart createVerticalXYBarChart(java.lang.String title,
                                                  java.lang.String xAxisLabel,
                                                  java.lang.String yAxisLabel,
                                                  IntervalXYDataset data,
                                                  boolean legend)
Creates and returns a default instance of a VerticalXYBarChart based on the specified dataset.

Parameters:
title - The chart title.
xAxisLabel - A label for the X-axis.
yAxisLabel - A label for the Y-axis.
data - The dataset for the chart.
legend - A flag specifying whether or not a legend is required.

createHighLowChart

public static JFreeChart createHighLowChart(java.lang.String title,
                                            java.lang.String timeAxisLabel,
                                            java.lang.String valueAxisLabel,
                                            HighLowDataset data,
                                            boolean legend)
Creates and returns a default instance of a high-low-open-close chart based on the specified dataset.

Parameters:
title - The chart title.
timeAxisLabel - A label for the time axis.
valueAxisLabel - A label for the value axis.
data - The dataset for the chart.
legend - A flag specifying whether or not a legend is required.

createCandlestickChart

public static JFreeChart createCandlestickChart(java.lang.String title,
                                                java.lang.String timeAxisLabel,
                                                java.lang.String valueAxisLabel,
                                                HighLowDataset data,
                                                boolean legend)
Creates and returns a default instance of a candlesticks chart based on the specified dataset.

Parameters:
title - The chart title.
timeAxisLabel - A label for the time axis.
valueAxisLabel - A label for the value axis.
data - The dataset for the chart.
legend - A flag specifying whether or not a legend is required.

createSignalChart

public static JFreeChart createSignalChart(java.lang.String title,
                                           java.lang.String timeAxisLabel,
                                           java.lang.String valueAxisLabel,
                                           SignalsDataset data,
                                           boolean legend)
Creates and returns a default instance of a signal chart based on the specified dataset.

Parameters:
title - The chart title.
timeAxisLabel - A label for the time axis.
valueAxisLabel - A label for the value axis.
data - The dataset for the chart.
legend - A flag specifying whether or not a legend is required.


Copyright © 2003 MBARI.

The Monterey Bay Aquarium Research Institute (MBARI) provides this documentation and code "as is", with no warranty, express or implied, of its quality or consistency. It is provided without support and without obligation on the part of MBARI to assist in its use, correction, modification, or enhancement.