-
Notifications
You must be signed in to change notification settings - Fork 150
/
Copy pathhc_responsive.Rd
42 lines (37 loc) · 1.14 KB
/
hc_responsive.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/highcharts-api.R
\name{hc_responsive}
\alias{hc_responsive}
\title{Responsive options for highcharter objects}
\usage{
hc_responsive(hc, ...)
}
\arguments{
\item{hc}{A \code{highchart} \code{htmlwidget} object.}
\item{...}{Arguments defined in \url{https://api.highcharts.com/highcharts/responsive}.}
}
\description{
Allows setting a set of rules to apply for different screen or chart
sizes. Each rule specifies additional chart options.
}
\examples{
leg_500_opts <- list(enabled = FALSE)
leg_900_opts <- list(align = "right", verticalAlign = "middle", layout = "vertical")
# change the with of the container/windows to see the effect
highchart() |>
hc_add_series(data = cumsum(rnorm(100))) |>
hc_responsive(
rules = list(
# remove legend if there is no much space
list(
condition = list(maxWidth = 500),
chartOptions = list(legend = leg_500_opts)
),
# put legend on the right when there is much space
list(
condition = list(minWidth = 900),
chartOptions = list(legend = leg_900_opts)
)
)
)
}