org.jfree.chart

## Class ChartFactory

- java.lang.Object
- - org.jfree.chart.ChartFactory

-     public abstract class ChartFactory
      extends java.lang.Object

  A collection of utility methods for creating some standard charts with JFreeChart.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ChartFactory()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static JFreeChart` | `createScatterPlot(java.lang.String title, java.lang.String xAxisLabel, java.lang.String yAxisLabel, XYDataset dataset)` Creates a scatter plot with default settings.
    `static JFreeChart` | `createScatterPlot(java.lang.String title, java.lang.String xAxisLabel, java.lang.String yAxisLabel, XYDataset dataset, PlotOrientation orientation, boolean legend, boolean tooltips, boolean urls)` Creates a scatter plot with default settings.
    `static JFreeChart` | `createXYLineChart(java.lang.String title, java.lang.String xAxisLabel, java.lang.String yAxisLabel, XYDataset dataset)` Creates a line chart (based on an `XYDataset`) with default settings.
    `static JFreeChart` | `createXYLineChart(java.lang.String title, java.lang.String xAxisLabel, java.lang.String yAxisLabel, XYDataset dataset, PlotOrientation orientation, boolean legend, boolean tooltips, boolean urls)` Creates a line chart (based on an `XYDataset`) with default settings.
    `static ChartTheme` | `getChartTheme()` Returns the current chart theme used by the factory.
    `static void` | `setChartTheme(ChartTheme theme)` Sets the current chart theme.

    - ### 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

    - #### getChartTheme

          public static ChartTheme getChartTheme()

      Returns the current chart theme used by the factory.
      Returns:
        The chart theme.
      Since:
        1.0.11
      See Also:
        `setChartTheme(ChartTheme)`, `ChartUtilities.applyCurrentTheme(JFreeChart)`

    - #### setChartTheme

          public static void setChartTheme(ChartTheme theme)

      Sets the current chart theme. This will be applied to all new charts created via methods in this class.
      Parameters:
        `theme` - the theme (`null` not permitted).
      Since:
        1.0.11
      See Also:
        `getChartTheme()`, `ChartUtilities.applyCurrentTheme(JFreeChart)`

    - #### createScatterPlot

          public static JFreeChart createScatterPlot(java.lang.String title,
                                                     java.lang.String xAxisLabel,
                                                     java.lang.String yAxisLabel,
                                                     XYDataset dataset)

      Creates a scatter plot with default settings. The chart object returned by this method uses an `XYPlot` instance as the plot, with a `NumberAxis` for the domain axis, a `NumberAxis` as the range axis, and an `XYLineAndShapeRenderer` as the renderer.
      Parameters:
        `title` - the chart title (`null` permitted).
        `xAxisLabel` - a label for the X-axis (`null` permitted).
        `yAxisLabel` - a label for the Y-axis (`null` permitted).
        `dataset` - the dataset for the chart (`null` permitted).
      Returns:
        A scatter plot.
      Since:
        1.0.16

    - #### createScatterPlot

          public static JFreeChart createScatterPlot(java.lang.String title,
                                                     java.lang.String xAxisLabel,
                                                     java.lang.String yAxisLabel,
                                                     XYDataset dataset,
                                                     PlotOrientation orientation,
                                                     boolean legend,
                                                     boolean tooltips,
                                                     boolean urls)

      Creates a scatter plot with default settings. The chart object returned by this method uses an `XYPlot` instance as the plot, with a `NumberAxis` for the domain axis, a `NumberAxis` as the range axis, and an `XYLineAndShapeRenderer` as the renderer.
      Parameters:
        `title` - the chart title (`null` permitted).
        `xAxisLabel` - a label for the X-axis (`null` permitted).
        `yAxisLabel` - a label for the Y-axis (`null` permitted).
        `dataset` - the dataset for the chart (`null` permitted).
        `orientation` - the plot orientation (horizontal or vertical) (`null` NOT permitted).
        `legend` - a flag specifying whether or not a legend is required.
        `tooltips` - configure chart to generate tool tips?
        `urls` - configure chart to generate URLs?
      Returns:
        A scatter plot.

    - #### createXYLineChart

          public static JFreeChart createXYLineChart(java.lang.String title,
                                                     java.lang.String xAxisLabel,
                                                     java.lang.String yAxisLabel,
                                                     XYDataset dataset)

      Creates a line chart (based on an `XYDataset`) with default settings.
      Parameters:
        `title` - the chart title (`null` permitted).
        `xAxisLabel` - a label for the X-axis (`null` permitted).
        `yAxisLabel` - a label for the Y-axis (`null` permitted).
        `dataset` - the dataset for the chart (`null` permitted).
      Returns:
        The chart.

    - #### createXYLineChart

          public static JFreeChart createXYLineChart(java.lang.String title,
                                                     java.lang.String xAxisLabel,
                                                     java.lang.String yAxisLabel,
                                                     XYDataset dataset,
                                                     PlotOrientation orientation,
                                                     boolean legend,
                                                     boolean tooltips,
                                                     boolean urls)

      Creates a line chart (based on an `XYDataset`) with default settings.
      Parameters:
        `title` - the chart title (`null` permitted).
        `xAxisLabel` - a label for the X-axis (`null` permitted).
        `yAxisLabel` - a label for the Y-axis (`null` permitted).
        `dataset` - the dataset for the chart (`null` permitted).
        `orientation` - the plot orientation (horizontal or vertical) (`null` NOT permitted).
        `legend` - a flag specifying whether or not a legend is required.
        `tooltips` - configure chart to generate tool tips?
        `urls` - configure chart to generate URLs?
      Returns:
        The chart.