apexcharter/man/ax_theme.Rd

54 lines
1.2 KiB
Plaintext
Raw Normal View History

2018-07-31 22:56:51 +02:00
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/apex-utils.R
\name{ax_theme}
\alias{ax_theme}
\title{Theme for charts}
\usage{
2019-11-26 10:17:42 +01:00
ax_theme(ax, mode = c("light", "dark"), palette = NULL, monochrome = NULL, ...)
2018-07-31 22:56:51 +02:00
}
\arguments{
\item{ax}{An \code{\link[=apexchart]{apexchart()}} \code{htmlwidget} object.}
2018-07-31 22:56:51 +02:00
2019-06-24 22:07:23 +02:00
\item{mode}{use light or dark theme.}
2018-07-31 22:56:51 +02:00
\item{palette}{Character. Available palettes: \code{"palette1"} to \code{"palette10"}.}
2018-09-03 23:52:53 +02:00
\item{monochrome}{A list of parameters.}
2018-07-31 22:56:51 +02:00
\item{...}{Additional parameters.}
}
\value{
An \code{\link[=apexchart]{apexchart()}} \code{htmlwidget} object.
2018-07-31 22:56:51 +02:00
}
\description{
Theme for charts
}
2018-09-03 23:52:53 +02:00
\note{
See \url{https://apexcharts.com/docs/options/theme/}
}
2019-06-24 22:07:23 +02:00
\examples{
data("mpg", package = "ggplot2")
data("diamonds", package = "ggplot2")
# Dark mode
apex(
2021-01-15 10:53:51 +01:00
data = mpg,
mapping = aes(x = manufacturer)
2019-06-24 22:07:23 +02:00
) \%>\%
ax_theme(mode = "dark")
# Use predefined palette (1 to 10)
apex(
2021-01-15 10:53:51 +01:00
data = diamonds,
mapping = aes(x = color, fill = cut)
2019-06-24 22:07:23 +02:00
) \%>\%
ax_theme(palette = "palette2")
# monochrome palette
apex(
2021-01-15 10:53:51 +01:00
data = diamonds,
mapping = aes(x = color, fill = cut)
2019-06-24 22:07:23 +02:00
) \%>\%
ax_theme(monochrome = list(enabled = TRUE, color = "#0B6121"))
}