`xl_chart_axis()` describes one axis, and is given to [xl_chart()] as `x_axis` or `y_axis`.
Several options apply to one kind of axis only, and Excel discards the rest without a word, so writexl refuses them instead. A scatter chart plots numbers against numbers, so both of its axes are **value** axes; every other type has a **category** x axis and a value y axis. (A bar chart is drawn with its categories up the side, but the axes keep their names.) Pie and doughnut charts have no axes at all.
* value axes only --- `min`, `max`, `log_base`, `major_unit`, `minor_unit`, `display_units`, `display_units_visible`; * category axes only --- `position`, `label_align`, `interval_unit`, `interval_tick`.
xl_chart_axis(
title = NULL,
title_format = NULL,
title_layout = NULL,
label_format = NULL,
num_format = NULL,
line_format = NULL,
visible = NA,
reverse = NA,
min = NA,
max = NA,
log_base = NA,
major_unit = NA,
minor_unit = NA,
display_units = NULL,
display_units_visible = NA,
interval_unit = NA,
interval_tick = NA,
position = NULL,
label_position = NULL,
label_align = NULL,
major_tick = NULL,
minor_tick = NULL,
crossing = NULL,
major_gridlines = NA,
minor_gridlines = NA,
major_gridlines_format = NULL,
minor_gridlines_format = NULL
)An `xl_chart_axis` object.
The axis title: a string, or a range spec holding one --- see [xl_chart_series()] for the spellings, including `list(header = "revenue")`.
An [xl_format()] styling the axis title. A title is text, so only the [xl_font()] group applies.
Where to put the axis title by hand, as `c(x, y)` fractions of the chart, each above 0 and at most 1. Excel places it for you otherwise.
An [xl_format()] styling the tick labels --- the [xl_font()] group only.
A number format for the tick labels, as an Excel format string (`"#,##0"`) or an [xl_num_format()].
An [xl_format()] styling the axis line itself: [xl_border()] for the line, [xl_fill()] for the fill behind it. An axis has four parts that can be styled, so none of them is just `format`.
`FALSE` hides the axis.
Draw the axis in the opposite direction.
The axis bounds. Value axes only.
Use a logarithmic scale with this base, 2 or more. Value axes only.
The spacing between major and minor tick marks. Value axes only.
Scale the labels by `"thousands"`, `"millions"`, `"billions"` and so on; see Details for the full set. Value axes only.
Whether the caption naming the units --- the small rotated "Millions" beside the axis --- is drawn. Setting `display_units` turns it **on**, as Excel does, so this is really for `FALSE`: rescaled labels with no caption. Value axes only.
Label one category in every `n`. Category axes only.
Put a tick mark on one category in every `n`. Category axes only.
Whether the data sits `"on_tick"` or `"between"` the tick marks. Category axes only.
Where the tick labels go: `"next_to"`, `"high"`, `"low"`, or `"none"` for no labels.
Tick-label alignment: `"center"`, `"left"` or `"right"`. Category axes only.
The tick marks: `"default"`, `"none"`, `"inside"`, `"outside"` or `"crossing"`.
Where the other axis crosses this one: a number, or `"min"` or `"max"` for either end.
Show the gridlines. A chart's major y gridlines are on by default and everything else is off.
An [xl_format()] styling the gridlines --- [xl_border()] only, since a gridline is a line.
`display_units` is one of `"none"`, `"hundreds"`, `"thousands"`, `"ten_thousands"`, `"hundred_thousands"`, `"millions"`, `"ten_millions"`, `"hundred_millions"`, `"billions"` or `"trillions"`.
[xl_chart], [xl_chart_series]
Other images and charts:
xl_chart(),
xl_chart_error_bars(),
xl_chart_labels(),
xl_chart_legend(),
xl_chart_marker(),
xl_chart_series(),
xl_chart_table(),
xl_chart_trendline(),
xl_chartsheet(),
xl_image()
xl_chart_axis(title = "Quarter")
xl_chart_axis(title = "Revenue", min = 0, num_format = "$#,##0",
major_gridlines = FALSE)
Run the code above in your browser using DataLab