public final class

ColumnSeries

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

Class Overview

Displays a ColumnSeries on the chart. A ColumnSeries is visualized as a vertical rectangle on the chart, where the height of the rectangle equates to the y value of the data point. The area of the column can be filled, depending on the style of the series.

ColumnSeries may be stacked on top of each other by using the setStackId(Integer) method.

Summary

[Expand]
Inherited Constants
From class com.shinobicontrols.charts.Series
Public Constructors
ColumnSeries()
Constructs a new ColumnSeries.
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<ColumnSeriesStyle> getSeriesStyleProvider()
Returns a SeriesStyleProvider which provides ColumnSeriesStyle objects for the purposes of styling this ColumnSeries' per-point applicable styles.
void setNumberOfCornerEdges(int numberOfCornerEdges)
Sets the number of edges, per corner, to use to create rounded bars and columns.
void setSeriesStyleProvider(SeriesStyleProvider<ColumnSeriesStyle> seriesStyleProvider)
Sets the SeriesStyleProvider to be used to provide ColumnSeriesStyle objects for the purposes of styling this ColumnSeries' per-point applicable styles.
void setStackingToken(StackingToken stackingToken)
Sets the StackingToken for this ColumnSeries.
[Expand]
Inherited Methods
From class com.shinobicontrols.charts.CartesianSeries
From class com.shinobicontrols.charts.Series
From class java.lang.Object

Public Constructors

public ColumnSeries ()

Constructs a new ColumnSeries.

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

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

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

Returns

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<ColumnSeriesStyle> seriesStyleProvider)

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

public void setStackingToken (StackingToken stackingToken)

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

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

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

ColumnSeries given the same cumulative StackingToken instance will be placed consecutively at each shared X value. The first series added to the chart is placed at the bottom, starting at the baseline, with subsequent series offset so that they begin at the top of the previous series. Note that the Y values must either all be positive or all be negative at each data point for every cumulatively stacked series otherwise the chart rendering may produce some unexpected results.

For example, consider two cumulatively stacked ColumnSeries:

  • Series 1 - (1, 2), (2, -1)
  • Series 2 - (1, 7), (2, -3)

This is acceptable as at each data point all of the Y values are either all positive or all negative.

Also note, where two or more series are stacked together, regardless of stacking type, their values must be sorted with respect to the X axis.

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 ColumnSeries