Package com.jfcbuilder.builders
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 Summary
Modifier and TypeMethodDescriptionorg.jfree.data.xy.XYDataset
build()
Builds the XYDatasetGets the color to use for drawing OHLCV items on days where price closed down (lower than open).Sets the color to use for drawing OHLCV items on days where price closed down (lower than open).static VolumeXYTimeSeriesBuilder
get()
Factory method for obtaining new instances of this class.indexRange
(ZeroBasedIndexRange indexRange) Sets the zero-based index range used to index into all source data for building the XYDataset.ohlcv
(OhlcvSeries ohlcv) Sets the OHLCV data to be used for building the XYDataset.timeData
(long[] timeData) Sets the time data to be used for generating the XYDataset.upColor()
Gets the color to use for drawing OHLCV items on days where price closed up (higher than open).Sets the color to use for drawing OHLCV items on days where price closed up (higher than open).
-
Method Details
-
get
Factory method for obtaining new instances of this class.- Returns:
- New instance of this class
-
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
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
Gets the color to use for drawing OHLCV items on days where price closed up (higher than open).- Returns:
- The color
-
downColor
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
Gets the color to use for drawing OHLCV items on days where price closed down (lower than open).- Returns:
- The color
-
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 interfaceIXYTimeSeriesDatasetBuilder<VolumeXYTimeSeriesBuilder>
- Parameters:
indexRange
- The index range to be set- Returns:
- Reference to this builder instance for method chaining
-
timeData
Description copied from interface:IXYTimeSeriesDatasetBuilder
Sets the time data to be used for generating the XYDataset.- Specified by:
timeData
in interfaceIXYTimeSeriesDatasetBuilder<VolumeXYTimeSeriesBuilder>
- Parameters:
timeData
- Ascending date-time values represented as milliseconds since the epoch start- Returns:
- Reference to this builder instance for method chaining
-
build
Description copied from interface:IXYTimeSeriesDatasetBuilder
Builds the XYDataset- Specified by:
build
in interfaceIXYTimeSeriesDatasetBuilder<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.
-