% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/axis_setting.R
\name{chart_ax_x}
\alias{chart_ax_x}
\title{X axis settings}
\usage{
chart_ax_x(
  x,
  orientation,
  crosses,
  cross_between,
  major_tick_mark,
  minor_tick_mark,
  tick_label_pos,
  display,
  num_fmt,
  rotation,
  limit_min,
  limit_max,
  position,
  major_unit,
  minor_unit,
  major_time_unit,
  minor_time_unit
)
}
\arguments{
\item{x}{an \code{ms_chart} object.}

\item{orientation}{axis orientation, one of 'maxMin', 'minMax'.}

\item{crosses}{specifies how the axis crosses the perpendicular
axis, one of 'autoZero', 'max', 'min'.}

\item{cross_between}{specifies how the value axis crosses the
category axis between categories, one of 'between', 'midCat'.}

\item{major_tick_mark, minor_tick_mark}{tick marks position,
one of 'cross', 'in', 'none', 'out'.}

\item{tick_label_pos}{ticks labels position, one of 'high',
'low', 'nextTo', 'none'.}

\item{display}{should the axis be displayed (a logical of
length 1).}

\item{num_fmt}{number formatting. See the num_fmt section for more details.}

\item{rotation}{rotation angle. Value should be between \code{-360}
and \code{360}.}

\item{limit_min}{minimum value on the axis. Date objects are also accepted
and will be converted automatically.}

\item{limit_max}{maximum value on the axis. Date objects are also accepted
and will be converted automatically.}

\item{position}{the value at which this axis crosses the perpendicular axis.}

\item{major_unit}{numeric, interval between major ticks and gridlines.}

\item{minor_unit}{numeric, interval between minor ticks and gridlines.}

\item{major_time_unit}{time unit for major ticks on date axes,
one of \code{"days"}, \code{"months"}, \code{"years"}.}

\item{minor_time_unit}{time unit for minor ticks on date axes,
one of \code{"days"}, \code{"months"}, \code{"years"}.}
}
\value{
An \code{ms_chart} object.
}
\description{
Define settings for an x axis.
}
\section{num_fmt}{

All \verb{\%} need to be doubled, \verb{0\%\%} means "a number
and percent symbol".

To my current knowledge, depending on the chart type
and options, the following values are not systematically
used by office chart engine; i.e. when chart pre-compute
percentages, it seems using \verb{0\%\%} will have no
effect.
\itemize{
\item \code{General}: default value
\item \code{0}: display the number with no decimal
\item \code{0.00}: display the number with two decimals
\item \verb{0\%\%}: display as percentages
\item \verb{0.00\%\%}: display as percentages with two decimal places
\item \verb{#,##0}
\item \verb{#,##0.00}
\item \code{0.00E+00}
\item \verb{# ?/?}
\item \verb{# ??/??}
\item \code{mm-dd-yy}
\item \code{d-mmm-yy}
\item \code{d-mmm}
\item \code{mmm-yy}
\item \verb{h:mm AM/PM}
\item \verb{h:mm:ss AM/PM}
\item \code{h:mm}
\item \code{h:mm:ss}
\item \verb{m/d/yy h:mm}
\item \verb{#,##0 ;(#,##0)}
\item \verb{#,##0 ;[Red](#,##0)}
\item \verb{#,##0.00;(#,##0.00)}
\item \verb{#,##0.00;[Red](#,##0.00)}
\item \code{mm:ss}
\item \verb{[h]:mm:ss}
\item \code{mmss.0}
\item \verb{##0.0E+0}
\item \code{@}
}
}

\section{Illustrations}{


\if{html}{\figure{fig_chart_ax_x_1.png}{options: width="500"}}
}

\examples{
library(mschart)

chart_01 <- ms_linechart(
  data = us_indus_prod,
  x = "date", y = "value",
  group = "type"
)

chart_01 <- chart_ax_y(x = chart_01, limit_min = 20, limit_max = 120)
chart_01

# control axis intervals
chart_01 <- chart_ax_x(chart_01,
  major_unit = 10, major_time_unit = "years"
)
chart_01 <- chart_ax_y(chart_01, major_unit = 20)
chart_01
}
\seealso{
\code{\link[=chart_ax_y]{chart_ax_y()}}, \code{\link[=ms_areachart]{ms_areachart()}}, \code{\link[=ms_barchart]{ms_barchart()}}, \code{\link[=ms_scatterchart]{ms_scatterchart()}},
\code{\link[=ms_linechart]{ms_linechart()}}
}
