public abstract class

CartesianSeries

extends Series<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>
Known Direct Subclasses

Class Overview

Abstract base class for cartesian series. To display a cartesian series use an appropriate subclass.

Do not attempt to create your own direct subclasses of CartesianSeries, but if you have a need for advanced customization you should start from one of the concrete series.

Summary

[Expand]
Inherited Constants
From class com.shinobicontrols.charts.Series
Public Methods
Object getBaseline()
Gets the user-set baseline value for this cartesian series.
Series.Orientation getOrientation()
Gets the orientation of the series.
Integer getStackId()
This method is deprecated. as of version 1.10.0, replaced by getStackingToken()
StackingToken getStackingToken()
Returns the current StackingToken for this series.
boolean isCrosshairEnabled()
Returns whether a Crosshair is displayed when the user performs a tap-and-hold gesture.
boolean isSelected()
Whether or not the series is currently selected
void setBaseline(Object baseline)
Sets the baseline value for this cartesian series.
void setCrosshairEnabled(boolean crosshairEnabled)
Sets whether a Crosshair should be displayed when the user performs a tap-and-hold gesture.
void setSelected(boolean selected)
Sets whether or not the series is selected, without requiring a user gesture Note that this does not force an immediate chart redraw.
void setStackId(Integer stackId)
This method is deprecated. as of version 1.10.0, replaced by setStackingToken(StackingToken) with token created by newCumulativeStackingToken()
void setStackingToken(StackingToken stackingToken)
Sets the StackingToken for this series.
[Expand]
Inherited Methods
From class com.shinobicontrols.charts.Series
From class java.lang.Object

Public Methods

public Object getBaseline ()

Gets the user-set 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.

Returns
  • The baseline for this cartesian series

public Series.Orientation getOrientation ()

Gets the orientation of the series.

Returns
  • The orientation of the series.

public Integer getStackId ()

This method is deprecated.
as of version 1.10.0, replaced by getStackingToken()

Gets the stack id for the series.

Series can be stacked on a chart, which means that their values are offset and they are rendered on top of each other, with the first series rendered at the bottom, offset from the baseline, with subsequent series offset so that they begin at the top of the previous series. Each stacked set in the chart is assigned an ID number representing the stack, and all series in a stack have the same stack ID. A series' stack ID may be null, indicating that the series is not stacked.

Returns
  • The stack id for the series.

public StackingToken getStackingToken ()

Returns the current StackingToken for this series.

The StackingToken denotes the way in which, and the series with which, this series is stacked.

Returns

public boolean isCrosshairEnabled ()

Returns whether a Crosshair is displayed when the user performs a tap-and-hold gesture. The crosshair consists of a tooltip and a circular target centered on a data point in a series.

For LineSeries, the tooltip will appear on the nearest series and interpolate values between data points. For ColumnSeries and BarSeries the crosshair will snap to the nearest column or bar. Once a crosshair is visible it is locked to that current series. It will ignore other series until it is dismissed and re-established on a different series. To dismiss the crosshair the user performs a single tap on the chart.

By default the crosshair is not enabled for this cartesian series.

Returns
  • whether a Crosshair is displayed when the user performs a tap-and-hold gesture

public boolean isSelected ()

Whether or not the series is currently selected

Returns
  • Whether or not the series is selected

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
See Also

public void setCrosshairEnabled (boolean crosshairEnabled)

Sets whether a Crosshair should be displayed when the user performs a tap-and-hold gesture.

By default the crosshair is not enabled for this cartesian series.

Enabling the crosshair will prevent any parent views from receiving any swipe or pinch gestures

Parameters
crosshairEnabled whether a Crosshair should be displayed when the user performs a tap-and-hold gesture

public void setSelected (boolean selected)

Sets whether or not the series is selected, without requiring a user gesture Note that this does not force an immediate chart redraw. If you require one, call it explicitly. Note also, that this method overrides the selection mode.

Parameters
selected Whether or not the series is to be selected
See Also

public void setStackId (Integer stackId)

This method is deprecated.
as of version 1.10.0, replaced by setStackingToken(StackingToken) with token created by newCumulativeStackingToken()

Sets the stack id for the series.

Series can be stacked on a chart, which means that their values are offset and they are rendered on top of each other, with the first series rendered at the bottom, offset from the baseline, with subsequent series offset so that they begin at the top of the previous series. Each stacked set in the chart is assigned an ID number representing the stack, and all series in a stack have the same stack ID.

To add a series to a stacked set, you call the setStackId(Integer) method with the ID of the stacked set you wish to add the series to.

A series' stack ID defaults to null. This indicates that the series is not stacked. The types of series that can be stacked are BarSeries, ColumnSeries and LineSeries.

Note that for LineSeries, all offsets must be either positive or negative otherwise you may find some strange visual effects around the crossing of the baseline. For BarSeries and ColumnSeries, all offsets must either be positive or negative at each data point. For example, two column series are stacked and have the following data points:

  • Series 1 - (3, 2), (4, -1)
  • Series 2 - (3, 7), (4, -3)
This is OK, whereas if the second series had a yValue of 2 for x=4, that stack would contain both positive and negative offsets and could produce strange effects.

Note also that if your series are stacked, their values must be sorted - with respect to the xAxis in the case of a column series or line series of horizontal orientation, and with respect to the yAxis in the case of a bar series or line series of vertical orientation.

Parameters
stackId the stack id for this series
See Also

public void setStackingToken (StackingToken stackingToken)

Sets the StackingToken for this series.

The StackingToken denotes the way in which, and the series with which, this series is stacked.

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 series