Skip to main content

ValueAxisDefinition

A value axis displays a set of values. It may be in either the X or Y axis, depending on how the chart is setup. For example, in a bar chart, the value axis is on the X axis, and the category axis is on the Y axis, but for a column chart it's the other way around. Scatter and bubble charts have a value axis in both X and Y.

Extends

Properties

crosshair?

optional crosshair: boolean | CrosshairOptions

Whether to show a crosshair for this axis. If you supply 'true', defaults will be used. Otherwise you can supply options to customise the crosshair.

Inherited from

AxisDefinitionCommon.crosshair


font?

optional font: FontSpec

Spec for the font to use for all text on the axis. If you provide a title spec for this axis, any font settings in that spec will override these for the title.

Inherited from

AxisDefinitionCommon.font


gridLineSize?

optional gridLineSize: number

Width of the grid lines. Defaults to 1 pixel.


id?

optional id: string

Axis ID.

Inherited from

AxisDefinitionCommon.id


inverted?

optional inverted: boolean

Whether or not to invert the axis. If true, the axis will run from max to min instead of min to max.


labelFormatter()?

optional labelFormatter: (value) => string

Optional formatter for all value labels.

Parameters

value

number

Returns

string


labelPrefix?

optional labelPrefix: string

Optional prefix for all value labels. Will be ignored if you provide a labelFormatter.


labelSuffix?

optional labelSuffix: string

Optional suffix for all value labels. Will be ignored if you provide a labelFormatter.


lineSize?

optional lineSize: number

The width of the baseline (if visible). Defaults to 2 pixels.

Inherited from

AxisDefinitionCommon.lineSize


max?

optional max: number

Maximum value for the axis. Defaults to not set. If this is set and your dataset has values above this value their visual representation in bar/column charts will be truncated. If you have a chart with multiple value axes and one or more of them declares a max, the largest value for max will be used for all axes.


min?

optional min: number

Minimum value for the axis. Defaults to not set. If this is set and your dataset has values below this value their visual representation in bar/column charts will be truncated. If you have a chart with multiple value axes and one or more of them declares a min, the smallest value for min will be used for all axes.


position?

optional position: AxisPosition

The position for the axis: for a Y axis, AXIS_POSITION_START means on the left (this is the default for a y axis), and AXIS_POSITION_END means on the right. For an X axis, AXIS_POSITION_START means on the top, and AXIS_POSITION_END means on the bottom (the default for an X axis).

Inherited from

AxisDefinitionCommon.position


showGrid?

optional showGrid: boolean

Whether or not to show grid lines for each value in the scale. Defaults to false.


showLine?

optional showLine: boolean

Whether or not to show a solid line representing the axis' baseline. Defaults to false.

Inherited from

AxisDefinitionCommon.showLine


step?

optional step: number

Optional fixed step size for the axis scale.


title?

optional title: AxisTitleSpec

Title for the axis. Defaults to empty.

Inherited from

AxisDefinitionCommon.title