Class OhlcSeriesBuilder

java.lang.Object
com.jfcbuilder.builders.OhlcSeriesBuilder
All Implemented Interfaces:
IXYTimeSeriesDatasetBuilder<OhlcSeriesBuilder>

public class OhlcSeriesBuilder extends Object implements IXYTimeSeriesDatasetBuilder<OhlcSeriesBuilder>
Builder for producing stock market Open High Low Close (OHLC) data sets that can be used in OHLC plots.
  • Method Details

    • get

      public static OhlcSeriesBuilder get()
      Factory method for obtaining new instances of this class.
      Returns:
      New instance of this class
    • ohlcv

      public OhlcSeriesBuilder ohlcv(OhlcvSeries ohlcv)
      Sets the OHLCV data to be used for building the XYDataset.
      Parameters:
      ohlcv - The data to be set
      Returns:
      Reference to this builder instance for method chaining
    • upColor

      public OhlcSeriesBuilder upColor(Color color)
      Sets the color to use for drawing OHLCV items on days where price closed up (higher than open).
      Parameters:
      color - The color to be set
      Returns:
      Reference to this builder instance for method chaining
    • upColor

      public Color upColor()
      Gets the color to use for drawing OHLCV items on days where price closed up (higher than open).
      Returns:
      The color
    • downColor

      public OhlcSeriesBuilder downColor(Color color)
      Sets the color to use for drawing OHLCV items on days where price closed down (lower than open).
      Parameters:
      color - The color to be set
      Returns:
      Reference to this builder instance for method chaining
    • downColor

      public Color downColor()
      Gets the color to use for drawing OHLCV items on days where price closed down (lower than open).
      Returns:
      The color
    • indexRange

      public OhlcSeriesBuilder indexRange(ZeroBasedIndexRange indexRange)
      Description copied from interface: IXYTimeSeriesDatasetBuilder
      Sets the zero-based index range used to index into all source data for building the XYDataset. This is an optimization to allow clients to supply existing data without having to copy and/or crop it to match the desired size in chart.
      Specified by:
      indexRange in interface IXYTimeSeriesDatasetBuilder<OhlcSeriesBuilder>
      Parameters:
      indexRange - The index range to be set
      Returns:
      Reference to this builder instance for method chaining
    • timeData

      public OhlcSeriesBuilder timeData(long[] timeData)
      Description copied from interface: IXYTimeSeriesDatasetBuilder
      Sets the time data to be used for generating the XYDataset.
      Specified by:
      timeData in interface IXYTimeSeriesDatasetBuilder<OhlcSeriesBuilder>
      Parameters:
      timeData - Ascending date-time values represented as milliseconds since the epoch start
      Returns:
      Reference to this builder instance for method chaining
    • build

      public org.jfree.data.xy.XYDataset build() throws IllegalStateException
      Description copied from interface: IXYTimeSeriesDatasetBuilder
      Builds the XYDataset
      Specified by:
      build in interface IXYTimeSeriesDatasetBuilder<OhlcSeriesBuilder>
      Returns:
      New instance of the corresponding XYDataset
      Throws:
      IllegalStateException - If source array sizes don't match or if an index range is configured and its indexes are out of bounds.