Class DemoDatasetFactory

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

public abstract class DemoDatasetFactory
extends Object
A utility class for generating sample datasets for the demos.

These datasets are hard-coded so that they are easily accessible for the demonstration applications. In a real application, you would create datasets dynamically by reading data from a file, a database, or some other source.

  • Constructor Details

    • DemoDatasetFactory

      public DemoDatasetFactory()
  • Method Details

    • createCategoryDataset

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

      public static CategoryDataset createSingleCategoryDataset()
      Creates and returns a category dataset with JUST ONE CATEGORY for the demo charts.
      Returns:
      a sample category dataset.
    • createSingleSeriesCategoryDataset

      public static CategoryDataset createSingleSeriesCategoryDataset()
      Creates and returns a category dataset for the demo charts.
      Returns:
      a sample category dataset.
    • createIntervalCategoryDataset

      public static IntervalCategoryDataset createIntervalCategoryDataset()
      Returns a null interval category dataset.
      Returns:
      null.
    • createSampleXYDataset

      public static XYDataset createSampleXYDataset()
      Returns a sample XY dataset.
      Returns:
      a sample XY dataset.
    • createTimeSeriesCollection1

      public static TimeSeriesCollection createTimeSeriesCollection1()
      Returns a dataset consisting of one annual series.
      Returns:
      a sample time series collection.
    • createTimeSeriesCollection2

      public static TimeSeriesCollection createTimeSeriesCollection2()
      Creates a time series collection containing JPY/GBP exchange rates.
      Returns:
      a sample time series collection.
    • createTimeSeriesCollection3

      public static TimeSeriesCollection createTimeSeriesCollection3()
      Creates a time series collection containing USD/GBP and EUR/GBP exchange rates.
      Returns:
      a sample time series collection.
    • createTimeSeriesCollection4

      public static TimeSeriesCollection createTimeSeriesCollection4()
      Returns a time series dataset using millisecond data.
      Returns:
      a sample time series collection.
    • createUSDTimeSeries

      public static TimeSeries createUSDTimeSeries()
      Returns a time series of the daily USD/GBP exchange rates in 2001 (to date), for use in the JFreeChart demonstration application.

      You wouldn't normally create a time series in this way. Typically, values would be read from a database.

      Returns:
      a time series.
    • createEURTimeSeries

      public static TimeSeries createEURTimeSeries()
      Returns a time series of the daily EUR/GBP exchange rates in 2001 (to date), for use in the JFreeChart demonstration application.

      You wouldn't normally create a time series in this way. Typically, values would be read from a database.

      Returns:
      a time series.
    • createJPYTimeSeries

      public static TimeSeries createJPYTimeSeries()
      Returns a time series of the daily EUR/GBP exchange rates in 2001 (to date), for use in the JFreeChart demonstration application.

      You wouldn't normally create a time series in this way. Typically, values would be read from a database.

      Returns:
      a sample time series.
    • createSampleSignalDataset

      public static SignalsDataset createSampleSignalDataset()
      Returns a sample signal dataset.
      Returns:
      a sample signal dataset.
    • createHighLowDataset

      public static HighLowDataset createHighLowDataset()
      Creates a sample high low dataset.
      Returns:
      a sample high low dataset.
    • createSegmentedHighLowDataset

      public static HighLowDataset createSegmentedHighLowDataset​(SegmentedTimeline timeline, Date start)
      Creates a sample high low dataset for a SegmentedTimeline
      Parameters:
      timeline - SegmenteTimeline that will use this dataset.
      start - Date from where the dataset will be generated. Actual dates will be generated dynamically based on the timeline.
      Returns:
      a sample high low dataset.
    • createWindDataset1

      public static WindDataset createWindDataset1()
      Creates a sample wind dataset.
      Returns:
      a sample wind dataset.
    • createWaferMapDataset

      public static WaferMapDataset createWaferMapDataset()
      Creates a sample wafermap dataset.
      Returns:
      a sample wafermap dataset
    • createRandomWaferMapDataset

      public static WaferMapDataset createRandomWaferMapDataset​(int values)
      Creates a random wafermap dataset
      Parameters:
      values - Maximum number of random values
      Returns:
      a random wafermap dataset