% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/geom-arearange.R
\name{hc_arearange}
\alias{hc_arearange}
\title{Highcharter Arearange Geom Function}
\usage{
hc_arearange(chart, spec, opts, geom_params, use_js = TRUE, ...)
}
\arguments{
\item{chart}{A \code{highchart} object (from \code{\link[=base_fig]{base_fig()}}).}

\item{spec}{An \code{\link[=hd_spec]{hd_spec()}} object.}

\item{opts}{An \code{\link[=hd_opts]{hd_opts()}} object.}

\item{geom_params}{Named list of geom-specific arguments (see above).}

\item{use_js}{Logical. Inject the hover-band JS callback.  Default \code{TRUE}.}

\item{...}{Unused; present for engine-contract consistency.}
}
\value{
The updated \code{highchart} object.
}
\description{
Adds an arearange series (and optionally a linked centre-line series) to a
partially-built \code{highchart} object.  Not intended to be called directly; use
\code{\link[=hd_geom_arearange]{hd_geom_arearange()}} or \code{hd_make(..., type = "arearange")}.
}
\section{Series strategy}{

For each group in \code{spec$data} two Highcharts series are added:
\enumerate{
\item A \code{"line"} series for the centre values (\code{spec$y}), rendered first
so it appears on top (higher z-index).  This series owns the legend
entry (\code{showInLegend = TRUE}).
\item An \code{"arearange"} series for the confidence band, linked back to the
line series via \code{linkedTo = line_id}.  This means clicking the legend
hides \emph{both} line and band together.  \code{showInLegend = FALSE} avoids a
duplicate legend entry.
}
When \code{show_line = FALSE} only the arearange series is added, and it owns
the legend entry itself.
}

\section{geom_params recognised}{

\describe{
\item{\code{ymin}}{Character. \strong{Required.} Column name for the lower bound.}
\item{\code{ymax}}{Character. \strong{Required.} Column name for the upper bound.}
\item{\code{show_line}}{Logical. Overlay the centre line.  Default \code{TRUE}.}
}
}

\keyword{internal}
