AxisBase Class
The base class for chart axes.
Declaration
public abstract class AxisBase extends ChartElement
Remarks
Axis and AxisEx classes derive from the AxisBase class. Axis descendants are axes of standard charts. AxisEx descendants are axes of chart types introduced in Microsoft Excel 2016 (for example, waterfall, histogram, or Pareto charts).
Refer to the following help topics for additional information:
- Customize Chart Axes — Presentation API for Java
- Create Waterfall, Funnel, Treemap, and Other Office 2016 Charts — Presentation API for Java
Inherited Members
Inheritance
Methods
deepClone() Method
Returns a deep copy of this AxisBase instance.
Declaration
public AxisBase deepClone()
Returns
| Type | Description |
|---|---|
AxisBase |
A deep copy of this |
getLabelTextProperties() Method
Returns text formatting settings for axis labels.
Declaration
public TextProperties getLabelTextProperties()
Returns
| Type | Description |
|---|---|
| TextProperties | Text formatting settings for axis labels, or |
getMajorGridlines() Method
Returns line settings for major gridlines.
Declaration
public ChartLineOptions getMajorGridlines()
Returns
| Type | Description |
|---|---|
| ChartLineOptions | Line settings for major gridlines, or |
getMajorTickMark() Method
Returns the position of major tick marks.
Declaration
public AxisTickMarkType getMajorTickMark()
Returns
| Type | Description |
|---|---|
| AxisTickMarkType | The position of major tick marks. |
getMinorGridlines() Method
Returns line settings for minor gridlines.
Declaration
public ChartLineOptions getMinorGridlines()
Returns
| Type | Description |
|---|---|
| ChartLineOptions | Line settings for minor gridlines, or |
getMinorTickMark() Method
Returns the position of minor tick marks.
Declaration
public AxisTickMarkType getMinorTickMark()
Returns
| Type | Description |
|---|---|
| AxisTickMarkType | The position of minor tick marks. |
getNumberFormat() Method
Returns number format settings for axis labels.
Declaration
public NumberFormatOptions getNumberFormat()
Returns
| Type | Description |
|---|---|
| NumberFormatOptions | Number format settings for axis labels. |
getTickLabelPosition() Method
Returns the position of tick labels relative to the axis.
Declaration
public AxisTickLabelPositionType getTickLabelPosition()
Returns
| Type | Description |
|---|---|
| AxisTickLabelPositionType | The position of tick labels relative to the axis. |
getTitle() Method
Returns axis title settings.
Declaration
public ChartTitleOptionsBase getTitle()
Returns
| Type | Description |
|---|---|
| ChartTitleOptionsBase | Axis title settings, or |
getVisible() Method
Returns whether the axis is visible.
Declaration
public boolean getVisible()
Returns
| Type | Description |
|---|---|
| boolean |
|
setLabelTextProperties(TextProperties value) Method
Sets text formatting settings for axis labels.
Declaration
public void setLabelTextProperties(TextProperties value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | TextProperties | Text formatting settings for axis labels. |
Remarks
To specify the background of axis labels, call the AxisBase.setFill(value) method. To format numbers in axis labels, call the setNumberFormat(NumberFormatOptions value) method.
setMajorGridlines(ChartLineOptions value) Method
Sets line settings for major gridlines.
Declaration
public void setMajorGridlines(ChartLineOptions value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | ChartLineOptions | Line settings for major gridlines, or |
Remarks
If you pass a ChartLineOptions object, the chart displays major gridlines for the axis. To hide major gridlines, call the setMajorGridlines(null) method.
setMajorTickMark(AxisTickMarkType value) Method
Sets the position of major tick marks.
Declaration
public void setMajorTickMark(AxisTickMarkType value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | AxisTickMarkType | The position of major tick marks. |
Exceptions
| Type | Description |
|---|---|
| NullPointerException | Thrown if the |
Remarks
The setMajorTickMark(value) method accepts the following values:
| Value | Description |
|---|---|
| CROSS | Indicates tick marks that cross the axis. |
| INSIDE | Indicates tick marks inside the plot area. |
| NONE | Indicates that the axis does not display tick marks. |
| OUTSIDE | Indicates tick marks outside the plot area. |
setMinorGridlines(ChartLineOptions value) Method
Sets line settings for minor gridlines.
Declaration
public void setMinorGridlines(ChartLineOptions value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | ChartLineOptions | Line settings for minor gridlines, or |
Remarks
If you pass a ChartLineOptions object, the chart displays minor gridlines for the axis. To hide minor gridlines, call the setMinorGridlines(null) method.
setMinorTickMark(AxisTickMarkType value) Method
Sets the position of minor tick marks.
Declaration
public void setMinorTickMark(AxisTickMarkType value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | AxisTickMarkType | The position of minor tick marks. |
Exceptions
| Type | Description |
|---|---|
| NullPointerException | Thrown if the |
Remarks
The setMinorTickMark(value) method accepts the following values:
| Value | Description |
|---|---|
| CROSS | Indicates tick marks that cross the axis. |
| INSIDE | Indicates tick marks inside the plot area. |
| NONE | Indicates that the axis does not display tick marks. |
| OUTSIDE | Indicates tick marks outside the plot area. |
setNumberFormat(NumberFormatOptions value) Method
Sets number format settings for axis labels.
Declaration
public void setNumberFormat(NumberFormatOptions value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | NumberFormatOptions | Number format settings for axis labels. |
Remarks
A new axis uses the General number format linked to source data. The createDefault() method returns these settings.
To display axis labels in a custom number format, pass a NumberFormatOptions object with a format code to the setNumberFormat(value) method. Refer to the NumberFormatOptions class description for additional information.
setTickLabelPosition(AxisTickLabelPositionType value) Method
Sets the position of tick labels relative to the axis.
Declaration
public void setTickLabelPosition(AxisTickLabelPositionType value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | AxisTickLabelPositionType | The position of tick labels relative to the axis. |
Exceptions
| Type | Description |
|---|---|
| NullPointerException | Thrown if the |
Remarks
The setTickLabelPosition(value) method accepts the following values:
| Value | Description |
|---|---|
| NONE | Indicates that the axis does not display tick labels. |
| HIGH | Indicates tick labels at the top of the chart (category and series axes) or on the right side of the chart (value axes). |
| LOW | Indicates tick labels at the bottom of the chart (category and series axes) or on the left side of the chart (value axes). |
| NEXT_TO | Indicates tick labels next to the axis. |
Note
Axes of chart types introduced in Microsoft Excel 2016 (AxisEx descendants) do not support HIGH and LOW positions. The AxisTickLabelPositionType.NONE value hides tick labels. Other values display tick labels next to the axis.
setTitle(ChartTitleOptionsBase value) Method
Sets axis title settings.
Declaration
public void setTitle(ChartTitleOptionsBase value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | ChartTitleOptionsBase | Axis title settings. |
setVisible(boolean value) Method
Sets whether the axis is visible.
Declaration
public void setVisible(boolean value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | boolean |
|