Class VolumeXYTimeSeriesBuilder

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

public class VolumeXYTimeSeriesBuilder extends Object implements IXYTimeSeriesDatasetBuilder<VolumeXYTimeSeriesBuilder>
Builder for producing stock market volume data sets that can be used in Volume XY plots.
  • Method Details

    • get

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

      public VolumeXYTimeSeriesBuilder 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 VolumeXYTimeSeriesBuilder 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 VolumeXYTimeSeriesBuilder 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 VolumeXYTimeSeriesBuilder 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<VolumeXYTimeSeriesBuilder>
      Parameters:
      indexRange - The index range to be set
      Returns:
      Reference to this builder instance for method chaining
    • timeData

      public VolumeXYTimeSeriesBuilder 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<VolumeXYTimeSeriesBuilder>
      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<VolumeXYTimeSeriesBuilder>
      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.