AnyChart
API Reference
Still have questions?
Contact support
Top
You are looking at an outdated 7.2.0 version of this document. Switch to the 8.3.0 version to see the up to date information.

class anychart.scales.OrdinalTicks Improve this Doc

Extends: anychart.Base

Scale ticks settings.

Methods Overview

Miscellaneous
get()Returns an array of ticks. Each tick can be:
interval()Getter for ticks interval value.
names()Getter for tick names.
set()Setups ticks as an explicit array of fixed ticks.

Methods Description

get

Returns an array of ticks. Each tick can be:
  1. A value in terms of data, to make a tick on.
  2. An array of two values to make the tick from the first one to the second one.
Note: returns correct values only after anychart.scales.Base#finishAutoCalc or after chart.draw().

Returns:

Array - Array of ticks.

Try it:

interval

Getter for ticks interval value.

Returns:

number - Current interval value.
Setter for ticks interval value. Passed value as rounded and defaults to 1 in case of incorrect settings.

Params:

Name Type Description
value number Value to set.

Returns:

anychart.scales.OrdinalTicks - An instance of anychart.scales.OrdinalTicks class for method chaining.

Try it:

names

Getter for tick names.

Returns:

Array - Current ticks names.
Setter for tick names.

Params:

Name Type Description
values Array An array of tick aliases.

Returns:

anychart.scales.OrdinalTicks - An instance of anychart.scales.OrdinalTicks class for method chaining.

Try it:

set

Setups ticks as an explicit array of fixed ticks.

Params:

Name Type Description
ticks Array Explicit tick indexes array.

Returns:

anychart.scales.OrdinalTicks - Returns itself for chaining.

Try it: