Axis:update
methodAxis:update(options: chart.AxisUpdateOptions)Change the axis ticks, label, font size, format, grid, or colors.
-- Labels show each value as a percent, with grid lines across.
axis:update({
ticks = 3,
format = "{value} %",
label = "share",
grid = true,
grid_color = color("#a7c080"),
})options chart.AxisUpdateOptions options 8 keys Omitted keys keep their current value.
| Key | Type | Description |
|---|---|---|
| ticks | integer | Target tick count. |
| tick_values | number[] | Explicit tick positions as data values; on a band scale, 0-based band indices (0 is the first category), as scale:map takes them. |
| label | string | Axis title, centered along the axis beyond the tick labels; on a vertical axis it reads along the axis. |
| font_size | number | string | Size of the tick labels and the axis label — a number (px) or a unit string like "1.5rem"/"50vw". |
| format | string | Tick-label format string; the scale's kind selects how it is read. On a time scale it is a UTC date pattern of literal text plus %Y %m %d %H %M %S (%% for a percent sign), and an unknown specifier raises. On every other scale it is a numeric dialect with three forms: {:.N} for N fixed decimals, {} for plain stringification, or literal text with each {value} substituted. |
| grid | boolean | Draw grid lines. |
| color | Color | Axis / tick color. |
| grid_color | Color | Grid-line color. |