Axis Class
The base class for axes of standard charts.
Declaration
public abstract class Axis extends AxisBase
Remarks
CategoryAxis, DateAxis, ValueAxis, and SeriesAxis classes derive from the Axis class. Call the getAxisType() method to get the type of an axis.
The following table lists axes of standard chart types:
| Chart Type | Argument Axis | Value Axis | Series Axis |
|---|---|---|---|
| Area, bar, line, radar, stock | CategoryAxis or DateAxis | ValueAxis | – |
| 3D area and 3D bar charts with standard grouping, 3D line, surface, 3D surface | CategoryAxis or DateAxis | ValueAxis | SeriesAxis |
| Scatter, bubble | ValueAxis | ValueAxis | – |
| Pie, doughnut, 3D pie, bar of pie, pie of pie | – | – | – |
3D area and 3D bar charts with other grouping types have no series axis. Secondary axes do not include a series axis.
The argument axis is a DateAxis object if arguments of the first series contain dates.
Refer to the following help topic for additional information: Customize Chart Axes — Presentation API for Java.
Inherited Members
Inheritance
Methods
deepClone() Method
Returns a deep copy of this Axis instance.
Declaration
public Axis deepClone()
Returns
| Type | Description |
|---|---|
Axis |
A deep copy of this |
getAxisType() Method
Returns the axis type.
Declaration
public abstract AxisType getAxisType()
Returns
| Type | Description |
|---|---|
| AxisType | The axis type. |
Remarks
The getAxisType() method returns one of the following values:
| Value | Description |
|---|---|
| CATEGORY | Indicates a category axis. |
| VALUE | Indicates a value axis. |
| DATE | Indicates a date axis. |
| SERIES | Indicates a series (depth) axis. |
getCrossesAt() Method
Returns the value on the perpendicular axis at which the axis crosses it.
Declaration
public double getCrossesAt()
Returns
| Type | Description |
|---|---|
| double | The value on the perpendicular axis. |
getCrossType() Method
Returns the point at which the axis crosses the perpendicular axis.
Declaration
public AxisCrossType getCrossType()
Returns
| Type | Description |
|---|---|
| AxisCrossType | The crossing point. |
getPosition() Method
Returns the axis position in the chart.
Declaration
public AxisPositionType getPosition()
Returns
| Type | Description |
|---|---|
| AxisPositionType | The axis position. |
getScaling() Method
Returns axis scale settings.
Declaration
public AxisScaling getScaling()
Returns
| Type | Description |
|---|---|
| AxisScaling | Axis scale settings. |
getTitle() Method
Returns axis title settings.
Declaration
public ChartTitleOptions getTitle()
Returns
| Type | Description |
|---|---|
| ChartTitleOptions | Axis title settings, or |
setCrossesAt(double value) Method
Sets the value on the perpendicular axis at which the axis crosses it.
Declaration
public void setCrossesAt(double value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | double | The value on the perpendicular axis. |
Remarks
Note
The crossing value takes effect when you call the setCrossType(AxisCrossType.CUSTOM) method.
setCrossType(AxisCrossType value) Method
Sets the point at which the axis crosses the perpendicular axis.
Declaration
public void setCrossType(AxisCrossType value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | AxisCrossType | The crossing point. |
Remarks
The setCrossType(value) method accepts the following values:
| Value | Description |
|---|---|
| AUTO | Indicates that the crossing point is selected automatically. |
| MIN | Indicates that the axis crosses the perpendicular axis at the minimum value. |
| MAX | Indicates that the axis crosses the perpendicular axis at the maximum value. |
| CUSTOM | Indicates that the axis crosses the perpendicular axis at a custom value. |
If you do not call the setCrossType(value) method, the API uses AxisCrossType.AUTO. To specify a custom crossing value, call the setCrossType(AxisCrossType.CUSTOM) method and the setCrossesAt(double value) method.
When the axis is in a chart, the AxisCrossType.MIN and AxisCrossType.MAX values also move the axis to the corresponding side of the plot area. A series axis (SeriesAxis) ignores the crossing point.
setPosition(AxisPositionType value) Method
Sets the axis position in the chart.
Declaration
public void setPosition(AxisPositionType value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | AxisPositionType | The axis position. |
Remarks
The setPosition(value) method accepts the following values:
| Value | Description |
|---|---|
| BOTTOM | Indicates that the axis is at the bottom of the chart. |
| LEFT | Indicates that the axis is on the left side of the chart. |
| RIGHT | Indicates that the axis is on the right side of the chart. |
| TOP | Indicates that the axis is at the top of the chart. |
Use AxisPositionType.BOTTOM and AxisPositionType.TOP values for horizontal axes and AxisPositionType.LEFT and AxisPositionType.RIGHT values for vertical axes.
setScaling(AxisScaling value) Method
Sets axis scale settings.
Declaration
public void setScaling(AxisScaling value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | AxisScaling | Axis scale settings. |
Exceptions
| Type | Description |
|---|---|
| ArgumentNullException | Thrown if you call the |
Remarks
Scale settings include minimum and maximum axis values, the logarithmic scale, and the direction of axis values. Refer to the AxisScaling class description for additional information.
setTitle(ChartTitleOptions value) Method
Sets axis title settings.
Declaration
public void setTitle(ChartTitleOptions value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | ChartTitleOptions | Axis title settings. |