% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/xl_chartsheet.R
\name{xl_chartsheet}
\alias{xl_chartsheet}
\title{A sheet holding a single chart}
\usage{
xl_chartsheet(
  chart,
  tab_color = NULL,
  zoom = NA,
  protect = NULL,
  page = NULL,
  view = NULL
)
}
\arguments{
\item{chart}{The [xl_chart()] to fill the sheet with.}

\item{tab_color}{The colour of the sheet tab.}

\item{zoom}{The zoom level as a percentage, 10 to 400.}

\item{protect}{`TRUE`, a password string, or a named list. A chartsheet
has no cells, so of Excel's protection options it takes only
`no_content` (let the chart be edited) and `no_objects` (let the shapes
on it be edited); the worksheet options are refused by name.}

\item{page}{An [xl_page_setup()] describing how it prints.}

\item{view}{An [xl_sheet_view()] setting the tab state.}
}
\value{
An `xl_chartsheet` object.
}
\description{
`xl_chartsheet()` is a worksheet-sized chart: a tab of its own holding one
chart and no cells.  Give it to [write_xlsx()] in place of a data frame.

Because a chartsheet has no cells, every range in the chart's series must
name the sheet it plots --- `list(sheet = "Data", cols = "revenue")` or
`"Data!B2:B10"`.  A bare `list(cols = )` has nothing to resolve against and
is refused.

A chartsheet supports only part of what a worksheet does, and the parts it
does not are refused rather than dropped: of [xl_page_setup()] it takes the
orientation, paper size, margins and the header and footer; of
[xl_sheet_view()] it takes `active`, `selected`, `visible` and
  `first_tab`.
}
\examples{
sales <- data.frame(quarter = c("Q1", "Q2"), revenue = c(10, 25))
chart <- xl_chart("column",
                  xl_chart_series(values = list(sheet = "Data",
                                                cols = "revenue")))
write_xlsx(list(Data = sales, Overview = xl_chartsheet(chart)),
           tempfile(fileext = ".xlsx"))
}
\seealso{
[xl_chart], [xl_sheet]

Other images and charts:
\code{\link[=xl_chart]{xl_chart()}},
\code{\link[=xl_chart_axis]{xl_chart_axis()}},
\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_image]{xl_image()}}
}
\concept{images and charts}
