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

class anychart.core.axes.Linear Improve this Doc

Extends: anychart.core.VisualBase

Axis Class.
Any axis must be bound to a scale.
To obtain a new instance of Axis use anychart.axes#linear.

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.
minorLabels()Getter for axis minor labels.
minorTicks()Getter for minor axis ticks.
orientation()Getter for axis orientation.
overlapMode()Getter for overlap mode for labels.
scale()Getter for axis scale.
staggerLines()Getter for stagger lines.
staggerMaxLines()Getter for maximum stagger lines.
staggerMode()Getter for stagger mode state.
stroke()Getter for axis stroke settings.
ticks()Getter for axis ticks.
title()Getter for the axis title.
width()Getter for axis width.

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.core.axes.Linear - Self instance for method chaining.

Try it:

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.core.axes.Linear - Self instance for method chaining.

Try it:

getRemainingBounds

Returns remaining parent bounds to use elsewhere.

Returns:

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

Try it:

isHorizontal

Whether an axis is horizontal.

Returns:

boolean - Returns true if the axis is horizontal.

Try it:

labels

Getter for axis labels.

Returns:

anychart.core.ui.LabelsFactory - Axis labels instance.

Try it:

Setter for axis labels.

Params:

Name Type Description
value Object | boolean | null Value to set.

Returns:

anychart.core.axes.Linear - Self instance for method chaining.

minorLabels

Getter for axis minor labels.

Returns:

anychart.core.ui.LabelsFactory - Axis labels instance.

Try it:

Setter for axis minor labels.

Params:

Name Type Description
value Object | boolean | null Value to set.

Returns:

anychart.core.axes.Linear - Self instance for method chaining.

minorTicks

Getter for minor axis ticks.

Returns:

anychart.core.axes.Ticks - Axis ticks.

Try it:

Setter for minor axis ticks.

Params:

Name Type Description
value Object | boolean | null Value to set.

Returns:

anychart.core.axes.Linear - Self instance for method chaining.

orientation

Getter for axis orientation.

Returns:

anychart.enums.Orientation - Axis orientation.
Setter for axis orientation.

Params:

Name Type Default Description
value string | anychart.enums.Orientation
'top'
Value to set.

Returns:

anychart.core.axes.Linear - Self instance for method chaining.

Try it:

overlapMode

Getter for overlap mode for labels.

Returns:

anychart.enums.LabelsOverlapMode - Overlap mode flag.
Setter for overlap mode for labels.

Params:

Name Type Default Description
value anychart.enums.LabelsOverlapMode | string
'noOverlap'
Value to set.

Returns:

anychart.core.axes.Linear - Self instance for method chaining.

Try it:

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.core.axes.Linear - Self instance for method chaining.

Try it:

staggerLines

Getter for stagger lines.

Returns:

number - Current stagger line settings.
Setter for stagger lines. Note: pass null to enable autocalculation.

Params:

Name Type Default Description
value number
null
Count of stager lines.

Returns:

anychart.core.axes.Linear - Self instance for method chaining.

Try it:

staggerMaxLines

Getter for maximum stagger lines.

Returns:

number - Current stagger line settings.
Setter for maximum stagger lines in autocalculation mode (if anychart.core.axes.Linear#staggerLines passed null).

Params:

Name Type Default Description
value number | null
2
Limits the number of lines to be used when drawing labels. If we need less – we use less, but never – more.

Returns:

anychart.core.axes.Linear - Self instance for method chaining.

Try it:

staggerMode

Getter for stagger mode state.

Returns:

boolean - Current stagger mode state.
Setter for stagger mode state.

Params:

Name Type Default Description
value boolean
true
On/off stagger mode.

Returns:

anychart.core.axes.Linear - Self instance for method chaining.

Try it:

stroke

Getter for axis stroke settings.

Returns:

anychart.graphics.vector.Stroke - Axis line stroke settings.
Setter for axis stroke settings. Learn more about stroke settings.

Params:

Name Type Default Description
value anychart.graphics.vector.Stroke | anychart.graphics.vector.ColoredFill | string | function | null
'#474747'
Stroke settings.
thickness number
1
Line thickness.
dashpattern string
Controls the pattern of dashes and gaps used to stroke paths.
lineJoin anychart.graphics.vector.StrokeLineJoin
'round'
Line join style.
lineCap anychart.graphics.vector.StrokeLineCap
'square'
Line cap style.

Returns:

anychart.core.axes.Linear - Self instance for method chaining.

Try it:

ticks

Getter for axis ticks.

Returns:

anychart.core.axes.Ticks - Axis ticks.

Try it:

Setter for axis ticks.

Params:

Name Type Description
value Object | boolean | null Value to set.

Returns:

anychart.core.axes.Linear - Self instance for method chaining.

title

Getter for the axis title.

Returns:

anychart.core.ui.Title - Axis title.
Setter for the axis title.

Params:

Name Type Description
value null | boolean | Object | string Value to set.

Returns:

anychart.core.axes.Linear - Self instance for method chaining.

width

Getter for axis width.

Returns:

number string null - The current axis width.
Setter for axis width.

Params:

Name Type Default Description
value number | string
null
Value to set.

Returns:

anychart.core.axes.Linear - Self instance for method chaining.

Try it: