public class

CandlestickSeries

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.CandlestickSeries

Class Overview

Displays a candlestick series on the chart. Each data point in a candlestick series is visualized as a thick candle between the open and close values, with 'wicks' indicating the high and low positions.

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

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

Candlestick 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
CandlestickSeries()
Constructs a new CandlestickSeries.
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<CandlestickSeriesStyle> getSeriesStyleProvider()
Returns a SeriesStyleProvider which provides CandlestickSeriesStyle objects for the purposes of styling this CandlestickSeries' 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<CandlestickSeriesStyle> seriesStyleProvider)
Sets the SeriesStyleProvider to be used to provide CandlestickSeriesStyle objects for the purposes of styling this CandlestickSeries' per-point applicable styles.
void setStackingToken(StackingToken stackingToken)
Sets the StackingToken for this CandlestickSeries.
[Expand]
Inherited Methods
From class com.shinobicontrols.charts.CartesianSeries
From class com.shinobicontrols.charts.Series
From class java.lang.Object

Public Constructors

public CandlestickSeries ()

Constructs a new CandlestickSeries.

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<CandlestickSeriesStyle> getSeriesStyleProvider ()

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

By default, this CandlestickSeries 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<CandlestickSeriesStyle> seriesStyleProvider)

Sets the SeriesStyleProvider to be used to provide CandlestickSeriesStyle objects for the purposes of styling this CandlestickSeries' 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 CandlestickSeries' per-point applicable styles, must not be null

public void setStackingToken (StackingToken stackingToken)

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

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

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

CandlestickSeries cannot be stacked cumulatively. Attempting to set a cumulative StackingToken on a CandlestickSeries 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 CandlestickSeries