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
Name | Type | Description |
---|---|---|
format | Function | Function 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
Name | Type | Description |
---|---|---|
on | boolean | Whether 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
Name | Type | Description |
---|---|---|
on | boolean | Whether 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
Name | Type | Description |
---|---|---|
label | string | Text 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
Name | Type | Description |
---|---|---|
values | number[], 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])