% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/xl_chart_axis.R
\name{xl_chart_axis}
\alias{xl_chart_axis}
\title{An axis of a chart}
\usage{
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
)
}
\arguments{
\item{title}{The axis title: a string, or a range spec holding one --- see
[xl_chart_series()] for the spellings, including
`list(header = "revenue")`.}

\item{title_format}{An [xl_format()] styling the axis title.  A title is
text, so only the [xl_font()] group applies.}

\item{title_layout}{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.}

\item{label_format}{An [xl_format()] styling the tick labels --- the
[xl_font()] group only.}

\item{num_format}{A number format for the tick labels, as an Excel format
string (`"#,##0"`) or an [xl_num_format()].}

\item{line_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`.}

\item{visible}{`FALSE` hides the axis.}

\item{reverse}{Draw the axis in the opposite direction.}

\item{min, max}{The axis bounds.  Value axes only.}

\item{log_base}{Use a logarithmic scale with this base, 2 or more.  Value
axes only.}

\item{major_unit, minor_unit}{The spacing between major and minor tick marks.
Value axes only.}

\item{display_units}{Scale the labels by `"thousands"`, `"millions"`,
`"billions"` and so on; see Details for the full set.  Value axes only.}

\item{display_units_visible}{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.}

\item{interval_unit}{Label one category in every `n`.  Category axes only.}

\item{interval_tick}{Put a tick mark on one category in every `n`.
Category axes only.}

\item{position}{Whether the data sits `"on_tick"` or `"between"` the tick
marks.  Category axes only.}

\item{label_position}{Where the tick labels go: `"next_to"`, `"high"`,
`"low"`, or `"none"` for no labels.}

\item{label_align}{Tick-label alignment: `"center"`, `"left"` or `"right"`.
Category axes only.}

\item{major_tick, minor_tick}{The tick marks: `"default"`, `"none"`,
`"inside"`, `"outside"` or `"crossing"`.}

\item{crossing}{Where the other axis crosses this one: a number, or `"min"`
or `"max"` for either end.}

\item{major_gridlines, minor_gridlines}{Show the gridlines.  A chart's major
y gridlines are on by default and everything else is off.}

\item{major_gridlines_format, minor_gridlines_format}{An [xl_format()]
styling the gridlines --- [xl_border()] only, since a gridline is a line.}
}
\value{
An `xl_chart_axis` object.
}
\description{
`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`.
}
\details{
`display_units` is one of `"none"`, `"hundreds"`, `"thousands"`,
`"ten_thousands"`, `"hundred_thousands"`, `"millions"`, `"ten_millions"`,
`"hundred_millions"`, `"billions"` or `"trillions"`.
}
\examples{
xl_chart_axis(title = "Quarter")
xl_chart_axis(title = "Revenue", min = 0, num_format = "$#,##0",
              major_gridlines = FALSE)
}
\seealso{
[xl_chart], [xl_chart_series]

Other images and charts:
\code{\link[=xl_chart]{xl_chart()}},
\code{\link[=xl_chart_error_bars]{xl_chart_error_bars()}},
\code{\link[=xl_chart_labels]{xl_chart_labels()}},
\code{\link[=xl_chart_legend]{xl_chart_legend()}},
\code{\link[=xl_chart_marker]{xl_chart_marker()}},
\code{\link[=xl_chart_series]{xl_chart_series()}},
\code{\link[=xl_chart_table]{xl_chart_table()}},
\code{\link[=xl_chart_trendline]{xl_chart_trendline()}},
\code{\link[=xl_chartsheet]{xl_chartsheet()}},
\code{\link[=xl_image]{xl_image()}}
}
\concept{images and charts}
