The X axis or category axis. Normally this is the horizontal axis, though if the chart is inverted this is the vertical axis. In case of multiple axes, the xAxis node is an array of configuration objects.
Arguments
- hc
A
highcharthtmlwidgetobject.- ...
Options defined in https://api.highcharts.com/highcharts/xAxis.
Details
See the Axis class for programmatic access to the axis.
Named options update the first axis. Supply unnamed axis lists, individually or in one list, to replace the collection. Series can select an axis by ID.
Examples
# Mark the boundary between the two halves of the year without obscuring the data.
highcharts_demo() |>
hc_xAxis(
plotLines = list(list(
value = 5.5,
color = "#526472",
width = 2,
dashStyle = "Dash",
label = list(text = "Second half of the year")
))
)
# Give each series its own horizontal scale.
highchart() |>
hc_title(text = "Monthly and weekly cafe orders") |>
hc_yAxis(title = list(text = "Orders")) |>
hc_xAxis(
list(id = "month", title = list(text = "Month")),
list(id = "week", title = list(text = "Week"), opposite = TRUE)
) |>
hc_add_series(
data = c(7, 5, 8),
pointStart = 1,
name = "Monthly",
xAxis = "month"
) |>
hc_add_series(
data = c(3, 6, 4, 5),
pointStart = 1,
name = "Weekly",
xAxis = "week"
)
