% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/xl_chart_extras.R
\name{xl_chart_legend}
\alias{xl_chart_legend}
\title{A chart's legend}
\usage{
xl_chart_legend(
  position = NULL,
  format = NULL,
  layout = NULL,
  delete_series = NULL
)
}
\arguments{
\item{position}{Where the legend sits: `"right"` (Excel's default),
`"left"`, `"top"`, `"bottom"`, `"top_right"`, the `"overlay_*"` variants
that let the legend sit over the plot, or `"none"` to remove it.}

\item{format}{An [xl_format()] styling the legend text --- the [xl_font()]
group only, since libxlsxwriter gives a legend a font and nothing else.}

\item{layout}{Where to put the legend by hand, as `c(x, y)` or
`c(x, y, width, height)` --- fractions of the chart, each above 0 and at
most 1.  Excel places it for you otherwise.  `at` is a cell everywhere
else in writexl, so a chart's own fractions are a `layout`.}

\item{delete_series}{Series to leave out of the legend, by position: `2`
drops the second series' entry while still plotting it.  This is how a
trendline or a helper series is kept out of the key.}
}
\value{
An `xl_chart_legend` object.
}
\description{
`xl_chart_legend()` moves, styles or removes the legend, and can leave
individual series out of it.
}
\examples{
xl_chart_legend(position = "bottom")
xl_chart_legend(position = "none")
xl_chart_legend(delete_series = 2)
}
\seealso{
[xl_chart]

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_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}
