BottomAxis

live example

Explore the API in the live example.

api reference

BottomAxis()
Component implementing the bottom axis for charts. When this component is available for a widget, its API is exposed via the .bottomAxis namespace.
BottomAxis.format(format)
Sets the X tick format of the chart.

Parameters

NameTypeDescription
formatFunctionFunction to set as formatter.

Returns

Widget
Reference to the Widget's API.

Examples

// Set bottom axis format to percentages.
chart.bottomAxis.format(x => x + '%')
BottomAxis.hideAxisLine(on)
Hides the axis line on the axis.

Parameters

NameTypeDescription
onbooleanWhether hiding the axis line is on.

Returns

Widget
Reference to the Widget's API.

Examples

// Hide axis line for bottom axis.
chart.bottomAxis.hideAxisLine(true)
BottomAxis.hideTicks(on)
Hides the tick lines on the axis.

Parameters

NameTypeDescription
onbooleanWhether hiding ticks is on.

Returns

Widget
Reference to the Widget's API.

Examples

// Hide tick lines for bottom axis.
chart.bottomAxis.hideTicks(true)
BottomAxis.label(label)
Sets the X label for the chart.

Parameters

NameTypeDescription
labelstringText to set as the label.

Returns

Widget
Reference to the Widget's API.

Examples

// Set bottom axis label to 'time'.
chart.bottomAxis.label('time')
BottomAxis.values(values)
Sets the X tick values explicitly to the specified values.

Parameters

NameTypeDescription
valuesnumber[], string[]The values to show ticks for.

Returns

Widget
Reference to the Widget's API.

Examples

// Show tick values for bottom axis only at 1, 2 and 3.
chart.bottomAxis.values([1, 2, 3])