apexcharter/man/ax_theme.Rd

56 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-06-24 22:07:23 +02:00
ax_theme(ax, mode = c("light", "dark"), palette = NULL,
monochrome = NULL, ...)
2018-07-31 22:56:51 +02:00
}
\arguments{
\item{ax}{A \code{apexcharts} \code{htmlwidget} object.}
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{
A \code{apexcharts} \code{htmlwidget} object.
}
\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{
library(dplyr)
data("mpg", package = "ggplot2")
data("diamonds", package = "ggplot2")
# Dark mode
apex(
data = count(mpg, manufacturer),
mapping = aes(x = manufacturer, y = n)
) \%>\%
ax_theme(mode = "dark")
# Use predefined palette (1 to 10)
apex(
data = count(diamonds, cut, color),
mapping = aes(x = color, y = n, fill = cut)
) \%>\%
ax_theme(palette = "palette2")
# monochrome palette
apex(
data = count(diamonds, cut, color),
mapping = aes(x = color, y = n, fill = cut)
) \%>\%
ax_theme(monochrome = list(enabled = TRUE, color = "#0B6121"))
}