public abstract class

Series

extends Object
java.lang.Object
   ↳ com.shinobicontrols.charts.Series<T extends com.shinobicontrols.charts.SeriesStyle>
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

Abstract base class that represents series displayed on a chart.

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

Summary

Nested Classes
enum Series.GestureSelectionMode What should be selected when the user taps the chart. 
enum Series.Orientation The orientation of a series  
enum Series.SelectionMode This enum is deprecated. As of version 1.8.3, replaced by Series.GestureSelectionMode  
Public Methods
SeriesStyleProvider<T> createDefaultSeriesStyleProvider()
Creates the default SeriesStyleProvider for this Series type.
void enableAnimation(boolean enabled)
Sets whether or not animations are enabled on the series.
final ShinobiChart getChart()
The chart this series is attached to.
final DataAdapter<?, ?> getDataAdapter()
Returns the DataAdapter for this series.
SeriesAnimation getEntryAnimation()
Gets the animation which may be played when the series is added or shown.
SeriesAnimation getExitAnimation()
Gets the animation which may be played when the series is removed or hidden.
Series.GestureSelectionMode getGestureSelectionMode()
Gets the Series.GestureSelectionMode representing what should be selected when the user taps the chart.
T getSelectedStyle()
Gets the style settings for this series when it is marked as selected (or a point within it is selected).
Series.SelectionMode getSelectionMode()
Gets the setting for what should be selected when the user taps the chart.
T getStyle()
Gets the style settings for this series.
String getTitle()
Returns the title of this series that is displayed in the legend.
final Axis<?, ?> getXAxis()
The X axis this series is attached to.
final Axis<?, ?> getYAxis()
The Y axis this series is attached to.
boolean isAnimating()
Whether the series is currently doing an entry/exit animation.
boolean isAnimationEnabled()
Whether or not the animations are enabled on the series.
boolean isHidden()
Whether or not the series is currently hidden.
boolean isPointSelected(int index)
Determines whether a point in the series is selected.
boolean isSelected()
Whether or not the series is currently selected.
boolean isShownInLegend()
Whether or not the series is represented in the legend
final void setDataAdapter(DataAdapter<?, ?> dataAdapter)
Sets the DataAdapter for the series.
void setEntryAnimation(SeriesAnimation seriesAnimation)
Sets the animation which may be played when the series is added or shown.
void setExitAnimation(SeriesAnimation seriesAnimation)
Sets the animation which may be played when the series is removed or hidden.
void setGestureSelectionMode(Series.GestureSelectionMode gestureSelectionMode)
Sets the Series.GestureSelectionMode representing what should be selected when the user taps the chart.
void setHidden(boolean hidden)
Sets whether or not the series is hidden or shown.
void setPointSelected(boolean selected, int index)
Sets the selection state of a point in the series.
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.
final void setSelectedStyle(T style)
Sets the style for this series when it is marked as selected (or a point within it is selected).
void setSelectionMode(Series.SelectionMode selectionMode)
This method is deprecated. As of version 1.8.3, replaced by setGestureSelectionMode(GestureSelectionMode)
void setShownInLegend(boolean shownInLegend)
Sets whether or not the series should be represented in the legend.
final void setStyle(T style)
Sets the style for this series.
void setTitle(String title)
Sets the title of this series to be displayed in the legend.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public SeriesStyleProvider<T> createDefaultSeriesStyleProvider ()

Creates the default SeriesStyleProvider for this Series type.

Note, currently only the LineSeries, ColumnSeries, BarSeries, CandlestickSeries and OHLCSeries utilize the SeriesStyleProvider. All other Series types return null.

Returns

public void enableAnimation (boolean enabled)

Sets whether or not animations are enabled on the series. Note that series must have non-null entry or exit animations in order for them to play

Parameters
enabled Whether or not animations are enabled on the series

public final ShinobiChart getChart ()

The chart this series is attached to.

Returns
  • The chart this series is attached to.

public final DataAdapter<?, ?> getDataAdapter ()

Returns the DataAdapter for this series. It holds all of the series's Data objects and allows values to be added or removed.

Returns
  • The data adapter for this series which holds all of its data points

public SeriesAnimation getEntryAnimation ()

Gets the animation which may be played when the series is added or shown. Note that animations must be enabled in order to play.

Returns
  • The animation which may be played when the series is added or shown.

public SeriesAnimation getExitAnimation ()

Gets the animation which may be played when the series is removed or hidden. Note that animations must be enabled in order to play.

Returns
  • The animation which may be played when the series is removed or hidden.

public Series.GestureSelectionMode getGestureSelectionMode ()

Gets the Series.GestureSelectionMode representing what should be selected when the user taps the chart.

Returns

public T getSelectedStyle ()

Gets the style settings for this series when it is marked as selected (or a point within it is selected). Override any default settings or theme settings on a per series basis by editing the values in these style objects. Any changes to properties on the style are not reflected visually until redrawChart() is called.

Returns
  • The style settings for this series when it is selected

public Series.SelectionMode getSelectionMode ()

Gets the setting for what should be selected when the user taps the chart.

Returns
  • The setting for what should be selected when the user taps the chart.

public T getStyle ()

Gets the style settings for this series. Override any default settings or theme settings on a per series basis by editing the values in these style objects. Any changes to properties on the style are not reflected visually until redrawChart() is called.

Returns
  • The style settings for this series.

public String getTitle ()

Returns the title of this series that is displayed in the legend.

Returns
  • the title of this series that is displayed in the legend
See Also

public final Axis<?, ?> getXAxis ()

The X axis this series is attached to.

Returns
  • The X axis this series is attached to.

public final Axis<?, ?> getYAxis ()

The Y axis this series is attached to.

Returns
  • The Y axis this series is attached to.

public boolean isAnimating ()

Whether the series is currently doing an entry/exit animation.

Returns
  • Whether the series is currently doing an entry/exit animation.

public boolean isAnimationEnabled ()

Whether or not the animations are enabled on the series. Note that series must have non-null entry or exit animations in order for them to play

Returns
  • Whether or not animations are enabled on the series.

public boolean isHidden ()

Whether or not the series is currently hidden. It is possible that the series may be in the process of animating in or out. If this is the case isHidden() will only report true when the animation has finished.

Returns
  • Whether or not the series is hidden.

public boolean isPointSelected (int index)

Determines whether a point in the series is selected.

The given index refers to the index of the point in the list returned by getDataPointsForDisplay() rather than the indices of the points directly added to the DataAdapter. In most cases these will be the same but for certain scenarios, such as sampling for example, they may differ.

Querying for the selection status of an index that does not exist in the data points list will return false.

Parameters
index the index of the point in the list returned by getDataPointsForDisplay()
Returns
  • whether the point at the given index is selected

public boolean isSelected ()

Whether or not the series is currently selected. This method currently only has meaning for cartesian series.

Returns
  • Whether or not the series is selected

public boolean isShownInLegend ()

Whether or not the series is represented in the legend

Returns
  • whether or not the series is represented in the legend

public final void setDataAdapter (DataAdapter<?, ?> dataAdapter)

Sets the DataAdapter for the series. This is created independently from, and holds all of the data for, a series. A series must be given a data adapter in order to be displayed on a chart. The DataAdapter cannot be set to null; trying to set a null DataAdapter will result in an java.lang.IllegalArgumentException being thrown.

Parameters
dataAdapter The data adapter to set for this series, cannot be null
See Also

public void setEntryAnimation (SeriesAnimation seriesAnimation)

Sets the animation which may be played when the series is added or shown. Note that animations must be enabled in order to play.

Parameters
seriesAnimation The animation which may be played when the series is removed or hidden.

public void setExitAnimation (SeriesAnimation seriesAnimation)

Sets the animation which may be played when the series is removed or hidden. Note that animations must be enabled in order to play.

Parameters
seriesAnimation The animation which may be played when the series is removed or hidden.

public void setGestureSelectionMode (Series.GestureSelectionMode gestureSelectionMode)

Sets the Series.GestureSelectionMode representing what should be selected when the user taps the chart.

Parameters
gestureSelectionMode the Series.GestureSelectionMode representing what should be selected when the user taps the chart

public void setHidden (boolean hidden)

Sets whether or not the series is hidden or shown. This method may trigger an entry or exit animation, if animation is enabled on this series.

If animation is enabled and the Series is currently animating, any subsequent calls to this method will be ignored. To be notified of the end of a Series' animation you can use the ShinobiChart.OnSeriesAnimationListener callback interface.

If the series is stacked, then all other series with the same stackId will first animate out before the change takes place, and afterwards will all animate back in. To show or hide a number of Series at the same time use setHidden(List, boolean).

Also note that if the series has animations enabled, it will not actually be hidden until the animation has finished.

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

public void setPointSelected (boolean selected, int index)

Sets the selection state of a point in the series.

The given index refers to the index of the point in the list returned by getDataPointsForDisplay() rather than the indices of the points directly added to the DataAdapter. In most cases these will be the same but for certain scenarios, such as sampling for example, they may differ.

Attempting to select or deselect an index that does not exist in the data points list will be ignored.

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 the point should be selected
index the index of the point in the list returned by getDataPointsForDisplay()

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. This method currently only has meaning for cartesian series.

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

public final void setSelectedStyle (T style)

Sets the style for this series when it is marked as selected (or a point within it is selected). Override any default settings or theme settings on a per series basis by editing the values in these style objects. The new style is not reflected visually until redrawChart() is called.

Parameters
style The object containing the style settings for this series when it is selected

public void setSelectionMode (Series.SelectionMode selectionMode)

This method is deprecated.
As of version 1.8.3, replaced by setGestureSelectionMode(GestureSelectionMode)

Sets what should be selected when the user taps the chart.

Parameters
selectionMode The setting for what should be selected when the user taps the chart.

public void setShownInLegend (boolean shownInLegend)

Sets whether or not the series should be represented in the legend.

Parameters
shownInLegend whether or not the series should be represented in the legend

public final void setStyle (T style)

Sets the style for this series. Override any default settings or theme settings on a per series basis by editing the values in these style objects. The new style is not reflected visually until redrawChart() is called.

Parameters
style The object containing the style settings for this series
See Also

public void setTitle (String title)

Sets the title of this series to be displayed in the legend.

Parameters
title the title of this series to be displayed in the legend