public interface

ShinobiChart

com.shinobicontrols.charts.ShinobiChart

Class Overview

Displays data arranged in either CartesianSeries or PieDonutSeries.

A ShinobiChart will display its cartesian series (for example LineSeries, ColumnSeries, CandlestickSeries) if a cartesian series is added to it first, or all its pieDonut series ( DonutSeries, PieSeries) if a pieDonut series is added to it first. If a pieDonut series is added to a ‘cartesian chart’ or vice versa, an java.lang.IllegalStateException will be thrown.

Data is always represented by a series or a set of series. The Series determines the look and style of the data contained in a DataAdapter. There is a one-to-one relationship between a chart series and the data adapter it represents. A ShinobiChart will be updated to reflect any changes to data depending on the specific implementation of its series' data adapters.

A chart must have an x-axis and a y-axis to display cartesian series otherwise an java.lang.IllegalStateException will be thrown. For pieDonut series, however, the chart must not have any axes otherwise again an java.lang.IllegalStateException will be thrown.

For the ShinboiCharts for Android Trial Version, a valid license key must be set, using setLicenseKey(String), before the chart renders otherwise an InvalidLicenseException will be thrown. This is not necessary for the Standard Version.

Summary

Nested Classes
interface ShinobiChart.OnAxisMotionStateChangeListener Interface definition for a callback to be invoked when the motion state of an axis changes  
interface ShinobiChart.OnAxisRangeChangeListener Interface definition for a callback to be invoked when an axis range changes  
interface ShinobiChart.OnCrosshairActivationStateChangedListener Interface definition for a callback to be invoked when the Crosshair activation state changes. 
interface ShinobiChart.OnCrosshairDrawListener Interface definition for a callback to be invoked when a crosshair is about to be drawn. 
interface ShinobiChart.OnGestureListener Interface definition for callbacks to be invoked when the user makes touch gestures. 
interface ShinobiChart.OnInternalLayoutListener Interface definition for a callback to be invoked when the internal layout of the chart is complete  
interface ShinobiChart.OnPieDonutSliceLabelDrawListener Interface definition for a callback to be invoked when a pie or donut series label is about to be drawn. 
interface ShinobiChart.OnPieDonutSliceUpdateListener Interface definition for a callback to be invoked after a pie or donut slice has been created. 
interface ShinobiChart.OnSeriesAnimationListener Interface definition for a callback to be invoked when a series animation ends. 
interface ShinobiChart.OnSeriesSelectionListener Interface definition for a callback to be invoked when a series or point is selected or deselected. 
interface ShinobiChart.OnSnapshotDoneListener Interface definition for a callback to be invoked when a snapshot has been taken and is ready for use. 
interface ShinobiChart.OnTickMarkDrawListener Interface definition for a callback to be invoked when a tick mark is about to be drawn. 
interface ShinobiChart.OnTickMarkUpdateListener Interface definition for a callback to be invoked after a tick mark has been created. 
interface ShinobiChart.OnTrackingInfoChangedForCrosshairListener Interface definition for a callback to be invoked when the current series and data point tracking information has changed as a result of a user gesture. 
interface ShinobiChart.OnTrackingInfoChangedForTooltipListener Interface definition for a callback to be invoked when the current series and data point tracking information has changed as a result of a user gesture. 
Public Methods
abstract void addSeries(Series<?> series)
Adds the series to the chart.
abstract void addSeries(Series<?> series, Axis<?, ?> xAxis, Axis<?, ?> yAxis)
Adds the series to the chart, associating it with the specified X and Y axes.
abstract void addXAxis(Axis<?, ?> axis)
Adds an X-axis to this chart.
abstract void addYAxis(Axis<?, ?> axis)
Adds a Y-axis to this chart.
abstract void applyTheme(int themeResourceID, boolean overwrite)
Sets a style resource as the source for the chart.
abstract List<Axis<?, ?>> getAllXAxes()

Returns all X-axes associated with this chart.

abstract List<Axis<?, ?>> getAllYAxes()

Returns all Y-axes associated with this chart.

abstract AnnotationsManager getAnnotationsManager()
Returns the annotations manager.
abstract Rect getCanvasRect()
Retrieve the location of the canvas, with co-ordinates relative to the containing ChartView's position.
abstract Crosshair getCrosshair()
Returns the object that is displayed after a tap-and-hold gesture on the chart.
abstract String getInfo()
Returns version information about the shinobicharts library being used.
abstract Legend getLegend()
Returns the object that represents the chart's Legend.
abstract int getLongTouchTimeout()
Returns the time at which the chart considers a touch gesture to be a long touch rather than a single touch.
abstract Rect getPlotAreaRect()
Retrieve the location of the plot area, with co-ordinates relative to the containing ChartView's position.
abstract List<Series<?>> getSeries()

Returns a list containing all the series associated with this chart, indexed according to the order in which they were originally added.

abstract List<Series<?>> getSeriesForAxis(Axis<?, ?> axis)

Returns all the series associated with the specified axis.

abstract ChartStyle getStyle()
Gets the ChartStyle object that manages the style for the chart area.
abstract String getTitle()
Gets the text value from this chart's title label.
abstract MainTitleStyle getTitleStyle()
Gets the MainTitleStyle object that manages the style for the chart title.
abstract Axis<?, ?> getXAxis()
Returns this chart's primary X-axis.
abstract Axis<?, ?> getXAxisForSeries(Series<?> series)
Returns the X-axis for the specified series.
abstract Axis<?, ?> getYAxis()
Returns the primary Y-axis for this chart.
abstract Axis<?, ?> getYAxisForSeries(Series<?> series)
Returns the Y-axis for the specified series.
abstract boolean isSeriesSelectionSingle()
Determines whether selecting a series by a tap gesture will deselect other series on the chart.
abstract void redrawChart()
Redraws the chart's elements.
abstract boolean removeSeries(Series<?> series)
Removes the series from the chart.
abstract void removeXAxis(Axis<?, ?> axis)
Removes an X-axis from the chart.
abstract void removeYAxis(Axis<?, ?> axis)
Removes a Y-axis from the chart.
abstract void requestSnapshot()
Asks the chart to generate a snapshot image.
abstract void setHidden(List<Series<?>> seriesList, boolean hidden)
Sets whether or not each Series in the given list is hidden or shown.
abstract void setLicenseKey(String trialLicenseKey)
Sets a trial license key for this chart.
abstract void setLongTouchTimeout(int timeout)
Sets the time at which the chart considers a touch gesture to be a long touch rather than a single touch.
abstract void setOnAxisMotionStateChangeListener(ShinobiChart.OnAxisMotionStateChangeListener listener)
Provides an object to handle axis motion state change callbacks.
abstract void setOnAxisRangeChangeListener(ShinobiChart.OnAxisRangeChangeListener listener)
Provides an object to handle axis range change callbacks.
abstract void setOnCrosshairActivationStateChangedListener(ShinobiChart.OnCrosshairActivationStateChangedListener listener)
Provides an object to handle crosshair activation state change callbacks.
abstract void setOnCrosshairDrawListener(ShinobiChart.OnCrosshairDrawListener onCrosshairDrawListener)
Provides an object to handle crosshair draw callbacks.
abstract void setOnGestureListener(ShinobiChart.OnGestureListener listener)
Provides an object to handle gesture callbacks.
abstract void setOnInternalLayoutListener(ShinobiChart.OnInternalLayoutListener listener)
Provides an object to handle chart internal layout callbacks.
abstract void setOnPieDonutSliceLabelDrawListener(ShinobiChart.OnPieDonutSliceLabelDrawListener onPieDonutSeriesLabelDrawListener)
abstract void setOnPieDonutSliceUpdateListener(ShinobiChart.OnPieDonutSliceUpdateListener onPieDonutSliceUpdateListener)
abstract void setOnSeriesAnimationListener(ShinobiChart.OnSeriesAnimationListener listener)
Provides an object to handle series animation start / finish callbacks.
abstract void setOnSeriesSelectionListener(ShinobiChart.OnSeriesSelectionListener listener)
Provides an object to handle series selection state change callbacks.
abstract void setOnSnapshotDoneListener(ShinobiChart.OnSnapshotDoneListener listener)
Provides an object to handle snapshot ready callbacks.
abstract void setOnTickMarkDrawListener(ShinobiChart.OnTickMarkDrawListener onTickMarkDrawListener)
Sets the ShinobiChart.OnTickMarkDrawListener for the chart.
abstract void setOnTickMarkUpdateListener(ShinobiChart.OnTickMarkUpdateListener onTickMarkUpdateListener)
abstract void setOnTrackingInfoChangedForCrosshairListener(ShinobiChart.OnTrackingInfoChangedForCrosshairListener listener)
Provides an object to handle crosshair tracking info change callbacks.
abstract void setOnTrackingInfoChangedForTooltipListener(ShinobiChart.OnTrackingInfoChangedForTooltipListener listener)
Provides an object to handle tooltip tracking info change callbacks.
abstract void setSeriesSelectionSingle(boolean seriesSelectionIsSingle)
Controls whether selecting a series by a tap gesture will deselect other series on the chart.
abstract void setStyle(ChartStyle style)
Sets the ChartStyle object that manages the style for the chart area.
abstract void setTitle(String title)
Sets the text value of the chart's title label and displays it in the standard position.
abstract void setTitleStyle(MainTitleStyle titleStyle)
Sets the MainTitleStyle object that manages the style for the chart title.
abstract void setXAxis(Axis<?, ?> axis)
Sets the primary X-axis for this chart.
abstract void setYAxis(Axis<?, ?> axis)
Sets the primary Y-axis for this chart.

Public Methods

public abstract void addSeries (Series<?> series)

Adds the series to the chart. The series will be associated with the primary x and y axes. If no primary x or y axis has been set, then this series will automatically be associated with an axis when it is set as a primary axis.

If no style is set on the series, then it will assume a style from the chart's default style values. Otherwise, all properties on the style not explicitly specified by the user will be replaced by corresponding properties from the chart's default style values.

This method may trigger an entry animation, if animation is enabled on the series. While the series is animating, any attempts to remove or hide it will be ignored. To be notified of the end of a Series' animation you can use the ShinobiChart.OnSeriesAnimationListener callback interface.

Parameters
series The series to add to the chart

public abstract void addSeries (Series<?> series, Axis<?, ?> xAxis, Axis<?, ?> yAxis)

Adds the series to the chart, associating it with the specified X and Y axes. If xAxis or yAxis do not currently belong to the chart they will be added.

If no style is set on the series, then it will assume a style from the chart's default style values. Otherwise, all properties on the style not explicitly specified by the user will be replaced by corresponding properties from the chart's default style values.

This method may trigger an entry animation, if animation is enabled on the series. While the series is animating, any attempts to remove or hide it will be ignored. To be notified of the end of a Series' animation you can use the ShinobiChart.OnSeriesAnimationListener callback interface.

Parameters
series the series to add to the chart
xAxis the X Axis to associate the series to
yAxis the Y Axis to associate the series to

public abstract void addXAxis (Axis<?, ?> axis)

Adds an X-axis to this chart. If the chart does not have a primary X-axis, then axis will be set as the primary X-axis.

The shinobicharts Premium version has support for adding multiple X-axes to your chart. In the Standard version, only one X-axis is allowed and any attempts to add further X-axes will result in an java.lang.UnsupportedOperationException being thrown.

If no style is set on the axis, then it will assume a style from the chart's Theme. Otherwise, all properties on the style not explicitly specified by the user will be replaced by corresponding properties from the chart's Theme.

Attempting to add a null axis or an axis that already belongs to another chart will result in an java.lang.IllegalArgumentException being thrown. Attempting to add an axis that already belongs to this chart or trying to add an axis to a chart containing a PieDonutSeries will result in an java.lang.IllegalStateException being thrown.

Parameters
axis The axis to add as an X-axis for the chart

public abstract void addYAxis (Axis<?, ?> axis)

Adds a Y-axis to this chart. If the chart does not have a primary Y-axis, then axis will be set as the primary Y-axis.

The shinobicharts Premium version has support for adding multiple Y-axes to your chart. In the Standard version, only one Y-axis is allowed and any attempts to add further Y-axes will result in an java.lang.UnsupportedOperationException being thrown.

If no style is set on the axis, then it will assume a style from the chart's Theme. Otherwise, all properties on the style not explicitly specified by the user will be replaced by corresponding properties from the chart's Theme.

Attempting to add a null axis or an axis that already belongs to another chart will result in an java.lang.IllegalArgumentException being thrown. Attempting to add an axis that already belongs to this chart or trying to add an axis to a chart containing a PieDonutSeries will result in an java.lang.IllegalStateException being thrown.

Parameters
axis The axis to add as a Y-axis for the chart

public abstract void applyTheme (int themeResourceID, boolean overwrite)

Sets a style resource as the source for the chart. If overwrite is set to true all values in the style resource will be applied, if it is set to false all values in the style will be applied except those that have been set by the user using any of the .set methods of the styles.

Parameters
themeResourceID The R.style.id of the style to apply
overwrite Set to true to replace all values, false to only replace default values.

public abstract List<Axis<?, ?>> getAllXAxes ()

Returns all X-axes associated with this chart.

If there are none, the method will return an empty list.

This list is read-only. Attempts to add, remove or replace the contents of the list will result in an java.lang.UnsupportedOperationException being thrown. However, it is possible to modify the elements in the list.

Returns
  • All X-axes associated with this chart

public abstract List<Axis<?, ?>> getAllYAxes ()

Returns all Y-axes associated with this chart.

If there are none, the method will return an empty list.

This list is read-only. Attempts to add, remove or replace the contents of the list will result in an java.lang.UnsupportedOperationException being thrown. However, it is possible to modify the elements in the list.

Returns
  • All Y-axes associated with this chart

public abstract AnnotationsManager getAnnotationsManager ()

Returns the annotations manager. This handles the creation, addition and removal of Annotation objects to this chart; annotations are not created directly but instead are created through the annotations manager.

Annotations are a shinobicharts Premium Edition-only feature. Attempting to add annotations via the annotations manager with the Standard Edition will result in an java.lang.UnsupportedOperationException being thrown.

Returns
  • the annotation manager which handles the creation, addition and removal of annotations

public abstract Rect getCanvasRect ()

Retrieve the location of the canvas, with co-ordinates relative to the containing ChartView's position.

Returns
  • A Rect describing the area used to render the canvas.

public abstract Crosshair getCrosshair ()

Returns the object that is displayed after a tap-and-hold gesture on the chart. The Crosshair will draw a target circle over the tracked data point with lines extending from the circle to the axes. It will also display a tooltip on top of this showing the values for x and y at that data point.

Returns
  • the object that is displayed after a tap-and-hold gesture on the chart

public abstract String getInfo ()

Returns version information about the shinobicharts library being used. This information can also be obtained directly from the INFO field.

Returns
  • A String containing information on the version of the shinobicharts library being used

public abstract Legend getLegend ()

Returns the object that represents the chart's Legend.

Returns
  • The chart's legend

public abstract int getLongTouchTimeout ()

Returns the time at which the chart considers a touch gesture to be a long touch rather than a single touch.

Returns
  • the length of time in milliseconds before the ShinobiChart registers a long touch gesture

public abstract Rect getPlotAreaRect ()

Retrieve the location of the plot area, with co-ordinates relative to the containing ChartView's position.

Returns
  • A Rect describing the area used to render the plot area.

public abstract List<Series<?>> getSeries ()

Returns a list containing all the series associated with this chart, indexed according to the order in which they were originally added.

If there are none, the method will return an empty list.

This list is read-only. Attempts to add, remove or replace the contents of the list will result in an java.lang.UnsupportedOperationException being thrown. However, it is possible to modify the elements in the list.

To add series to the chart, use addSeries(Series) To remove series, use removeSeries(Series).

Returns
  • All the series associated with this chart

public abstract List<Series<?>> getSeriesForAxis (Axis<?, ?> axis)

Returns all the series associated with the specified axis.

If there are none, the method will return an empty list.

Parameters
axis The axis whose series are being retrieved
Returns
  • All series associated with axis

public abstract ChartStyle getStyle ()

Gets the ChartStyle object that manages the style for the chart area. Setting these values will override any values set by the theme. Any changes to properties on the style are not reflected visually until redrawChart() is called.

Returns
  • The chart's style

public abstract String getTitle ()

Gets the text value from this chart's title label.

Returns
  • The text for the title of this chart
See Also

public abstract MainTitleStyle getTitleStyle ()

Gets the MainTitleStyle object that manages the style for the chart title. Setting these values will override any values set by the theme. Any changes to properties on the style are not reflected visually until redrawChart() is called.

Returns
  • The chart title label's style

public abstract Axis<?, ?> getXAxis ()

Returns this chart's primary X-axis.

Returns
  • The primary X-axis for this chart
See Also

public abstract Axis<?, ?> getXAxisForSeries (Series<?> series)

Returns the X-axis for the specified series.

Parameters
series The series whose X-Axis is being retrieved
Returns
  • The X-axis for series

public abstract Axis<?, ?> getYAxis ()

Returns the primary Y-axis for this chart.

Returns
  • The primary Y-axis for this chart
See Also

public abstract Axis<?, ?> getYAxisForSeries (Series<?> series)

Returns the Y-axis for the specified series.

Parameters
series The series whose Y-Axis is being retrieved
Returns
  • The Y-axis for series

public abstract boolean isSeriesSelectionSingle ()

Determines whether selecting a series by a tap gesture will deselect other series on the chart.

Returns
  • True if selecting a series by a tap gesture will deselect other series on the chart.

public abstract void redrawChart ()

Redraws the chart's elements. Any styling changes applied since the last call to redrawChart() will be applied. In response to data changes, redrawChart() is automatically called.

public abstract boolean removeSeries (Series<?> series)

Removes the series from the chart.

This method may trigger an exit animation, if animation is enabled on the series. In this situation the series will not actually be removed until the animation is complete. While the series is animating, any attempts to add, show or hide it will be ignored. To be notified of the end of a Series' animation you can use the ShinobiChart.OnSeriesAnimationListener callback interface.

Parameters
series The series to remove
Returns
  • Whether the series has been removed immediately. Note that if the series has animations enabled, it will not actually be removed until the animation has finished

public abstract void removeXAxis (Axis<?, ?> axis)

Removes an X-axis from the chart. Any annotations that are associated with axis will also be removed from the chart.

Note, annotations are a premium-edition only feature.

Parameters
axis The X-axis to remove from the chart
See Also

public abstract void removeYAxis (Axis<?, ?> axis)

Removes a Y-axis from the chart. Any annotations that are associated with axis will also be removed from the chart.

Note, annotations are a premium-edition only feature.

Parameters
axis The Y-axis to remove from the chart
See Also

public abstract void requestSnapshot ()

Asks the chart to generate a snapshot image. If an ShinobiChart.OnSnapshotDoneListener has been registered, it will receive an android.graphics.Bitmap via the OnSnapshotDoneListener#onSnapshotDone(android.graphics.Bitmap bitmap) method of that interface. NOTE: This will cause the chart to redraw as part of the snapshot process, so any pending style changes will also be committed.

public abstract void setHidden (List<Series<?>> seriesList, boolean hidden)

Sets whether or not each Series in the given list is hidden or shown. This method may trigger an entry or exit animation, if animation is enabled on this Series in the list.

If animation is enabled, trying to hide or show a series that is currently animating will be ignored. To be notified of the end of a Series' animation you can use the ShinobiChart.OnSeriesAnimationListener callback interface. Note, a separate notification will be given for each Series in the list.

This method can be used to show or hide multiple Series that are stacked on top of each other in one go.

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

Parameters
seriesList the list of series to hide/show
hidden whether or not each series in the list is to be hidden

public abstract void setLicenseKey (String trialLicenseKey)

Sets a trial license key for this chart.

For the trial version of shinobicharts, a valid trial license key must be set before the chart will render. This is not necessary for any purchased (non-trial) version.

Parameters
trialLicenseKey the license key used to validate the trial version

public abstract void setLongTouchTimeout (int timeout)

Sets the time at which the chart considers a touch gesture to be a long touch rather than a single touch. This will have an affect on how quickly the Crosshair is displayed.

Setting this to a value lower than 60 will change the Crosshair behavior to simply toggle on and off. Please note, setting this to a value below 100 may detract from the user experience.

Parameters
timeout the length of time in milliseconds before the ShinobiChart registers a long touch gesture

public abstract void setOnAxisMotionStateChangeListener (ShinobiChart.OnAxisMotionStateChangeListener listener)

Provides an object to handle axis motion state change callbacks.

Parameters
listener The listener.

public abstract void setOnAxisRangeChangeListener (ShinobiChart.OnAxisRangeChangeListener listener)

Provides an object to handle axis range change callbacks.

Parameters
listener The listener.

public abstract void setOnCrosshairActivationStateChangedListener (ShinobiChart.OnCrosshairActivationStateChangedListener listener)

Provides an object to handle crosshair activation state change callbacks.

Parameters
listener The listener.

public abstract void setOnCrosshairDrawListener (ShinobiChart.OnCrosshairDrawListener onCrosshairDrawListener)

Provides an object to handle crosshair draw callbacks.

Parameters
onCrosshairDrawListener The listener.

public abstract void setOnGestureListener (ShinobiChart.OnGestureListener listener)

Provides an object to handle gesture callbacks.

Parameters
listener The listener.

public abstract void setOnInternalLayoutListener (ShinobiChart.OnInternalLayoutListener listener)

Provides an object to handle chart internal layout callbacks.

Parameters
listener The listener.

public abstract void setOnPieDonutSliceLabelDrawListener (ShinobiChart.OnPieDonutSliceLabelDrawListener onPieDonutSeriesLabelDrawListener)

Parameters
onPieDonutSeriesLabelDrawListener the onPieDonutSeriesLabelDrawListener to set

public abstract void setOnPieDonutSliceUpdateListener (ShinobiChart.OnPieDonutSliceUpdateListener onPieDonutSliceUpdateListener)

Parameters
onPieDonutSliceUpdateListener the onPieDonutSliceUpdateListener to set

public abstract void setOnSeriesAnimationListener (ShinobiChart.OnSeriesAnimationListener listener)

Provides an object to handle series animation start / finish callbacks.

Parameters
listener The listener.

public abstract void setOnSeriesSelectionListener (ShinobiChart.OnSeriesSelectionListener listener)

Provides an object to handle series selection state change callbacks.

Parameters
listener The listener.

public abstract void setOnSnapshotDoneListener (ShinobiChart.OnSnapshotDoneListener listener)

Provides an object to handle snapshot ready callbacks. Before calling myChart.requestSnapshot(), an ShinobiChart.OnSnapshotDoneListener will need to be provided via this method.

Typically the class calling this will itself implement the ShinobiChart.OnSnapshotDoneListener interface and override ShinobiChart.OnSnapshotDoneListener#onSnapshotDone(android.graphics.Bitmap) . It can then register itself to receive the call back by calling myChart.setOnSnapshotDoneListener(this).

Parameters
listener The listener.

public abstract void setOnTickMarkDrawListener (ShinobiChart.OnTickMarkDrawListener onTickMarkDrawListener)

Sets the ShinobiChart.OnTickMarkDrawListener for the chart.

Parameters
onTickMarkDrawListener the onTickMarkDrawListener to set

public abstract void setOnTickMarkUpdateListener (ShinobiChart.OnTickMarkUpdateListener onTickMarkUpdateListener)

Parameters
onTickMarkUpdateListener the onTickMarkUpdateListener to set

public abstract void setOnTrackingInfoChangedForCrosshairListener (ShinobiChart.OnTrackingInfoChangedForCrosshairListener listener)

Provides an object to handle crosshair tracking info change callbacks.

Parameters
listener The listener.

public abstract void setOnTrackingInfoChangedForTooltipListener (ShinobiChart.OnTrackingInfoChangedForTooltipListener listener)

Provides an object to handle tooltip tracking info change callbacks.

Parameters
listener The listener.

public abstract void setSeriesSelectionSingle (boolean seriesSelectionIsSingle)

Controls whether selecting a series by a tap gesture will deselect other series on the chart.

Parameters
seriesSelectionIsSingle Set true if selecting a series by a tap gesture should deselect other series on the chart.

public abstract void setStyle (ChartStyle style)

Sets the ChartStyle object that manages the style for the chart area. Values in style will override any values set by the theme. The new style is not reflected visually until redrawChart() is called.

Parameters
style The style for the chart
See Also

public abstract void setTitle (String title)

Sets the text value of the chart's title label and displays it in the standard position. Setting the title to null will cause it to be hidden.

Parameters
title The text for the title of this chart
See Also

public abstract void setTitleStyle (MainTitleStyle titleStyle)

Sets the MainTitleStyle object that manages the style for the chart title. Values in titleStyle will override any values set by the theme. The new style is not reflected visually until redrawChart() is called.

Parameters
titleStyle The style for the chart's title label
See Also

public abstract void setXAxis (Axis<?, ?> axis)

Sets the primary X-axis for this chart. If this chart already has a primary X-axis, the existing axis will be removed and axis will replace it as the primary X-axis.

If no style is set on the axis, then it will assume a style from the chart's Theme. Otherwise, all properties on the style not explicitly specified by the user will be replaced by corresponding properties from the chart's Theme.

Attempting to set a null axis or an axis that already belongs to another chart will result in an java.lang.IllegalArgumentException being thrown. Attempting to set an axis that already belongs to this chart or trying to set an axis on a chart containing a PieDonutSeries will result in an java.lang.IllegalStateException being thrown.

Parameters
axis The axis to set as the chart's primary X-axis
See Also

public abstract void setYAxis (Axis<?, ?> axis)

Sets the primary Y-axis for this chart. If this chart already has a primary Y-axis, the existing axis will be removed and axis will replace it as the primary Y-axis.

If no style is set on the axis, then it will assume a style from the chart's Theme. Otherwise, all properties on the style not explicitly specified by the user will be replaced by corresponding properties from the chart's Theme.

Attempting to set a null axis or an axis that already belongs to another chart will result in an java.lang.IllegalArgumentException being thrown. Attempting to set an axis that already belongs to this chart or trying to set an axis on a chart containing a PieDonutSeries will result in an java.lang.IllegalStateException being thrown.

Parameters
axis The axis to set as the chart's primary Y-axis
See Also