public class

OHLCSeries

extends CartesianSeries<T extends SeriesStyle>
java.lang.Object
   ↳ com.shinobicontrols.charts.Series<T extends com.shinobicontrols.charts.SeriesStyle>
     ↳ com.shinobicontrols.charts.CartesianSeries<T extends com.shinobicontrols.charts.SeriesStyle>
       ↳ com.shinobicontrols.charts.OHLCSeries

Class Overview

Displays an OHLC series on the chart. Each data point in an OHLC series is visualized as a line between the high and low values, with short perpendicular bars indicating the open and close positions.

OHLCSeries expects data points implementing MultiValueData, and MultiValueDataPoint implements this interface.

OHLC series do not stack, and the setStackId(Integer) method has no effect. Similarly, baselines are not applicable to OHLCSeries and the setBaseline(Object) method has no effect.

OHLC series are a Premium-only feature. In the Standard edition, attempting to add instances of the series to a chart will result in an java.lang.UnsupportedOperationException being thrown

Summary

[Expand]
Inherited Constants
From class com.shinobicontrols.charts.Series
Public Constructors
OHLCSeries()
Constructs a new OHLCSeries.
Public Methods
SeriesStyleProvider<T extends SeriesStyle> createDefaultSeriesStyleProvider()
Creates the default SeriesStyleProvider for this Series type.
int getNumberOfCornerEdges()
Returns the number of edges, per corner, used to create rounded bars and columns.
SeriesStyleProvider<OHLCSeriesStyle> getSeriesStyleProvider()
Returns a SeriesStyleProvider which provides OHLCSeriesStyle objects for the purposes of styling this OHLCSeries' per-point applicable styles.
void setBaseline(Object baseline)
Sets the baseline value for this cartesian series.
void setNumberOfCornerEdges(int numberOfCornerEdges)
Sets the number of edges, per corner, to use to create rounded bars and columns.
void setSeriesStyleProvider(SeriesStyleProvider<OHLCSeriesStyle> seriesStyleProvider)
Sets the SeriesStyleProvider to be used to provide OHLCSeriesStyle objects for the purposes of styling this OHLCSeries' per-point applicable styles.
void setStackingToken(StackingToken stackingToken)
Sets the StackingToken for this OHLCSeries.
[Expand]
Inherited Methods
From class com.shinobicontrols.charts.CartesianSeries
From class com.shinobicontrols.charts.Series
From class java.lang.Object

Public Constructors

public OHLCSeries ()

Constructs a new OHLCSeries.

Public Methods

public SeriesStyleProvider<T extends SeriesStyle> createDefaultSeriesStyleProvider ()

Creates the default SeriesStyleProvider for this Series type.

This particular implementation provides one of the two Series-level SeriesStyle objects: that obtained from getSelectedStyle() or from getStyle(), depending on whether the individual data point is selected or not.

Returns

public int getNumberOfCornerEdges ()

Returns the number of edges, per corner, used to create rounded bars and columns. It controls the smoothness, or resolution, of the rounded corners and can be used to optimize memory usage.

The number of corner edges is a value greater than or equal to 1. As the value is per corner, and each bar or column will have two corners rounded, a value of 1 will result in two edges on the bar or column tip, that is, a triangular tip.

The default value is 15.

This value can be lowered to reduce the amount of memory used when creating bars and columns with rounded corners. However, this will impact the smoothness of the rounded corners.

Conversely, this value can be raised to increase the smoothness of the rounded corners on bars and columns. However, this will impact performance and increase memory usage.

It is possible to change the extent of the rounding on a per-point basis using the setCornerRatio(float) and setCornerRatio(float) methods.

Returns
  • the number of edges used to create a rounded corner

public SeriesStyleProvider<OHLCSeriesStyle> getSeriesStyleProvider ()

Returns a SeriesStyleProvider which provides OHLCSeriesStyle objects for the purposes of styling this OHLCSeries' per-point applicable styles.

By default, this OHLCSeries has the SeriesStyleProvider created by the createDefaultSeriesStyleProvider() method set on it.

Returns

public void setBaseline (Object baseline)

Sets the baseline value for this cartesian series. This is on the X or Y-axis depending on the orientation of the series. For example, the Y-axis for LineSeries and ColumnSeries, the X-axis for BarSeries).

Certain styling options for a series are based on the baseline and thus the baseline value will affect the visual appearance of a series. For example, for a LineSeries, in its LineSeriesStyle object you can set the area color above and below the baseline.

If no baseline has been explicitly set this method will return null. In this case, for Bar and ColumnSeries, the baseline value that will be used internally will be zero. For LineSeries it will be the minimum of the axis' default range.

Financial series (BandSeries, OHLCSeries and CandlestickSeries) ignore any baseline value set on them.

Parameters
baseline The baseline for this cartesian series

public void setNumberOfCornerEdges (int numberOfCornerEdges)

Sets the number of edges, per corner, to use to create rounded bars and columns. It controls the smoothness, or resolution, of the rounded corners and can be used to optimize memory usage.

The number of corner edges must be a value greater than or equal to 1. Setting a zero or negative value will throw an IllegalArgumentException. As the value is per corner, and each bar or column will have two corners rounded, a value of 1 will result in two edges on the bar or column tip, that is, a triangular tip.

The default value is 15. Any change in value will automatically update the chart.

This value can be lowered to reduce the amount of memory used when creating bars and columns with rounded corners. However, this will impact the smoothness of the rounded corners.

Conversely, this value can be raised to increase the smoothness of the rounded corners on bars and columns. However, this will impact performance and increase memory usage.

It is possible to change the extent of the rounding on a per-point basis using the setCornerRatio(float) and setCornerRatio(float) methods.

Parameters
numberOfCornerEdges the number of edges, per corner, to use to create rounded bars and columns

public void setSeriesStyleProvider (SeriesStyleProvider<OHLCSeriesStyle> seriesStyleProvider)

Sets the SeriesStyleProvider to be used to provide OHLCSeriesStyle objects for the purposes of styling this OHLCSeries' per-point applicable styles.

SeriesStyleProvider implementations can achieve individual point styling by returning customized styles for particular data points based on their properties. The default SeriesStyleProvider for a particular Series type can be obtained through the createDefaultSeriesStyleProvider() method.

The given SeriesStyleProvider must not be null otherwise an IllegalArgumentException will be thrown.

Parameters
seriesStyleProvider the SeriesStyleProvider to use for styling this OHLCSeries' per-point applicable styles, must not be null

public void setStackingToken (StackingToken stackingToken)

Sets the StackingToken for this OHLCSeries. The token denotes the way in which, and the series with which, this series is stacked.

OHLCSeries given different StackingToken instances will be laid out side-by-side at each shared X value.

OHLCSeries given the same overlapping StackingToken instance will be overlaid at each shared X value.

OHLCSeries cannot be stacked cumulatively. Attempting to set a cumulative StackingToken on an OHLCSeries will be ignored.

A series' StackingToken cannot be null; attempting to set a null token will result in an IllegalArgumentException being thrown.

If this series belongs to a ShinobiChart, after setting the StackingToken the chart will be asked to redraw.

Parameters
stackingToken the StackingToken to set for this OHLCSeries