Top
You are looking at an outdated 7.0.0 version of this document. Switch to the 7.14.3 version to see the up to date information.

class anychart.elements.Axis Improve this Doc

Methods Overview

Miscellaneous
drawFirstLabel()Getter for the first label drawing flag.
drawLastLabel()Getter for the last label drawing flag.
getRemainingBounds()Returns remaining parent bounds to use elsewhere.
isHorizontal()Whether an axis is horizontal.
labels()Getter for axis labels.
length()Getter for axis length.
minorLabels()Getter for axis minor labels.
minorTicks()Getter for minor axis ticks.
name()Getter for axis name.
offsetX()Getter for axis X offset.
offsetY()Getter for axis Y offset.
orientation()Getter for axis orientation.
overlapMode()Getter for overlap mode for labels.
parentBounds()Getter for parentBounds.
scale()Getter for axis scale.
serialize()Axis serialization.
staggerLines()Stagger lines.
staggerMaxLines()Stagger max lines.
staggerMode()Stagger mode.
stroke()Getter for axis line stroke.
ticks()Getter for axis ticks.
title()Getter for the title axis.

Methods Description

drawFirstLabel

Getter for the first label drawing flag.

Returns:

boolean - Drawing flag.
Setter for the first label drawing flag.

Params:

Name Type Default Description
value boolean
true
Value to set.

Returns:

anychart.elements.Axis - anychart.elements.Axis instance for method chaining.

drawLastLabel

Getter for the last label drawing flag.

Returns:

boolean - Drawing flag.
Setter for the last label drawing flag.

Params:

Name Type Default Description
value boolean
true
Value to set.

Returns:

anychart.elements.Axis - anychart.elements.Axis instance for method chaining.

getRemainingBounds

Returns remaining parent bounds to use elsewhere.

Returns:

anychart.math.Rect - Parent bounds without the space used by the title.

isHorizontal

Whether an axis is horizontal.

Returns:

boolean - If the axis is horizontal.

labels

Getter for axis labels.

Returns:

anychart.elements.LabelsFactory - Axis labels of itself for method chaining.
Setter for axis labels.

Params:

Name Type Description
value anychart.elements.LabelsFactory Value to set.

Returns:

anychart.elements.Axis - An instance of the anychart.elements.Axis class for method chaining.

length

Getter for axis length.

Returns:

number - Axis length.
Setter for axis length.
Note: width and height swap in case of horizontal axis.

Params:

Name Type Description
value number Axis length.

Returns:

anychart.elements.Axis - anychart.elements.Axis instance for method chaining.

minorLabels

Getter for axis minor labels.

Returns:

anychart.elements.LabelsFactory - Axis labels.
Setter for axis minor labels.

Params:

Name Type Description
value anychart.elements.LabelsFactory Value to set.

Returns:

anychart.elements.Axis - anychart.elements.Axis class for method chaining.

minorTicks

Getter for minor axis ticks.

Returns:

anychart.elements.Ticks - Axis ticks.
Setter for minor axis ticks.

Params:

Name Type Description
value anychart.elements.Ticks Value to set.

Returns:

anychart.elements.Axis - anychart.elements.Axis instance for method chaining.

name

Getter for axis name.

Returns:

string - Axis name.
Setter for axis name.

Params:

Name Type Description
value string Name.

Returns:

anychart.elements.Axis - anychart.elements.Axis instance for method chaining.

offsetX

Getter for axis X offset.

Returns:

number - Offset by X.
Setter for axis X offset.

Params:

Name Type Description
value number Value to set.

Returns:

anychart.elements.Axis - anychart.elements.Axis instance for method chaining.

offsetY

Getter for axis Y offset.

Returns:

number - Offset by Y.
Setter for axis Y offset.

Params:

Name Type Description
value number Value to set.

Returns:

anychart.elements.Axis - anychart.elements.Axis for method chaining.

orientation

Getter for axis orientation.

Returns:

string anychart.utils.Orientation - Axis orientation.
Setter for axis orientation.

Params:

Name Type Description
value string | anychart.utils.Orientation Value to set.

Returns:

anychart.elements.Axis - An instance of the anychart.elements.Axis class for method chaining.

overlapMode

Getter for overlap mode for labels.

Returns:

anychart.elements.Axis.OverlapMode string - OverlapMode flag.
Setter for overlap mode for labels.

Params:

Name Type Default Description
value anychart.elements.Axis.OverlapMode | string
true
Value to set.

Returns:

anychart.elements.Axis - anychart.elements.Axis instance for method chaining.

parentBounds

Getter for parentBounds.

Returns:

anychart.graphics.math.Rect - Current parent bounds.
Setter for parentBounds.

Params:

Name Type Description
value anychart.graphics.math.Rect Value to set.

Returns:

anychart.elements.Axis - anychart.elements.Axis class for method chaining.

scale

Getter for axis scale.

Returns:

anychart.scales.Base - Axis scale.
Setter for axis scale.

Params:

Name Type Description
value anychart.scales.Base Value to set.

Returns:

anychart.elements.Axis - anychart.elements.Axis instance for method chaining.

serialize

Axis serialization.

Returns:

Object - Serialized axis data.

staggerLines

Stagger lines.

Params:

Name Type Description
value number | null On/off.

Returns:

null number anychart.elements.Axis - .

staggerMaxLines

Stagger max lines.

Params:

Name Type Description
value number | null .

Returns:

null number anychart.elements.Axis - .

staggerMode

Stagger mode.

Params:

Name Type Description
value boolean On/off.

Returns:

boolean anychart.elements.Axis - .

stroke

Getter for axis line stroke.

Returns:

string anychart.graphics.vector.Stroke - Axis line stroke settings.
Setter for axis line stroke.

Params:

Name Type Description
value string | anychart.graphics.vector.Stroke Value to set.

Returns:

anychart.elements.Axis - anychart.elements.Axis instance for method chaining.

ticks

Getter for axis ticks.

Returns:

anychart.elements.Ticks - Axis ticks.
Setter for axis ticks.

Params:

Name Type Description
value anychart.elements.Ticks Value to set.

Returns:

anychart.elements.Axis - anychart.elements.Axis instance for method chaining.

title

Getter for the title axis.

Returns:

string anychart.elements.Title - Axis title.
Setter for the title axis.

Params:

Name Type Description
value string | anychart.elements.Title Value to set.

Returns:

anychart.elements.Axis - anychart.elements.Axis class for method chaining.