% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ms_chart.R
\name{ms_areachart}
\alias{ms_areachart}
\title{Areachart object}
\usage{
ms_areachart(data, x, y, group = NULL, labels = NULL, asis = FALSE)
}
\arguments{
\item{data}{a data.frame}

\item{x}{column name for x values.}

\item{y}{column name for y values.}

\item{group}{grouping column name used to split data into series. Optional.}

\item{labels}{column names of columns to be used as custom data labels
displayed next to data points (not axis labels). Optional.
If more than one name is provided, only the first one will be used as a label, but all
labels (transposed if a group is used) will be available in the Excel file
associated with the chart.}

\item{asis}{logical parameter defaulting to FALSE. When FALSE, the data is
reshaped internally so that each series becomes a separate column. When TRUE,
the data is used as-is and must already have one column for categories and
one column per series, and \code{y} accepts a vector of series column names.
\code{asis} describes the \emph{input shape} read by the constructor. Not to be
confused with the \code{write_data} argument of \code{\link[=sheet_add_drawing.ms_chart]{sheet_add_drawing.ms_chart()}},
which controls whether \code{mschart} writes the chart's data into an Excel
sheet at embed time. The two are independent.}
}
\value{
An \code{ms_chart} object.
}
\description{
Creation of an areachart object that can be
inserted in a 'Microsoft' document.

Area charts can be used to plot change over time and draw attention to the
total value across a trend. By showing the sum of the plotted values, an area
chart also shows the relationship of parts to a whole.
}
\examples{
library(officer)
mytheme <- mschart_theme(
  axis_title_x = fp_text(color = "red", font.size = 24, bold = TRUE),
  axis_title_y = fp_text(color = "green", font.size = 12, italic = TRUE),
  grid_major_line_y = fp_border(width = 1, color = "orange"),
  axis_ticks_y = fp_border(width = 1, color = "orange")
)

# example ac_01 -------
ac_01 <- ms_areachart(
  data = browser_ts, x = "date",
  y = "freq", group = "browser"
)
ac_01 <- chart_ax_y(ac_01, cross_between = "between", num_fmt = "General")
ac_01 <- chart_ax_x(ac_01, cross_between = "midCat", num_fmt = "m/d/yy")
ac_01 <- set_theme(ac_01, mytheme)


# example ac_02 -------
ac_02 <- chart_settings(ac_01, grouping = "percentStacked")

# example ac_03 -------
ac_03 <- chart_settings(ac_01, grouping = "percentStacked", table = TRUE)
ac_03 <- chart_table(
  ac_03,
  horizontal = FALSE, vertical = FALSE,
  outline = FALSE, show_keys = TRUE)
}
\seealso{
\code{\link[=chart_settings]{chart_settings()}}, \code{\link[=chart_ax_x]{chart_ax_x()}}, \code{\link[=chart_ax_y]{chart_ax_y()}},
\code{\link[=chart_data_labels]{chart_data_labels()}}, \code{\link[=chart_theme]{chart_theme()}}, \code{\link[=chart_labels]{chart_labels()}}

Other 'Office' chart objects:
\code{\link[=ms_barchart]{ms_barchart()}},
\code{\link[=ms_boxplotchart]{ms_boxplotchart()}},
\code{\link[=ms_bubblechart]{ms_bubblechart()}},
\code{\link[=ms_chart_combine]{ms_chart_combine()}},
\code{\link[=ms_funnelchart]{ms_funnelchart()}},
\code{\link[=ms_histogramchart]{ms_histogramchart()}},
\code{\link[=ms_linechart]{ms_linechart()}},
\code{\link[=ms_paretochart]{ms_paretochart()}},
\code{\link[=ms_piechart]{ms_piechart()}},
\code{\link[=ms_radarchart]{ms_radarchart()}},
\code{\link[=ms_scatterchart]{ms_scatterchart()}},
\code{\link[=ms_stockchart]{ms_stockchart()}},
\code{\link[=ms_sunburstchart]{ms_sunburstchart()}},
\code{\link[=ms_treemapchart]{ms_treemapchart()}},
\code{\link[=ms_waterfallchart]{ms_waterfallchart()}}
}
\concept{'Office' chart objects}
