Package com.jfcbuilder.builders
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 Summary
Modifier and TypeMethodDescriptionorg.jfree.data.xy.XYDatasetbuild()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 OhlcSeriesBuilderget()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:IXYTimeSeriesDatasetBuilderSets 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:
indexRangein interfaceIXYTimeSeriesDatasetBuilder<OhlcSeriesBuilder>- Parameters:
indexRange- The index range to be set- Returns:
- Reference to this builder instance for method chaining
-
timeData
Description copied from interface:IXYTimeSeriesDatasetBuilderSets the time data to be used for generating the XYDataset.- Specified by:
timeDatain interfaceIXYTimeSeriesDatasetBuilder<OhlcSeriesBuilder>- 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:IXYTimeSeriesDatasetBuilderBuilds the XYDataset- Specified by:
buildin interfaceIXYTimeSeriesDatasetBuilder<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.
-