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_colors}
|
|
|
|
\alias{ax_colors}
|
|
|
|
\title{Colors}
|
|
|
|
\usage{
|
|
|
|
ax_colors(ax, ...)
|
|
|
|
}
|
|
|
|
\arguments{
|
|
|
|
\item{ax}{A \code{apexcharts} \code{htmlwidget} object.}
|
|
|
|
|
2020-02-15 13:07:05 +01:00
|
|
|
\item{...}{Colors for the chart's series. When all colors are used, it starts from the beginning.}
|
2018-07-31 22:56:51 +02:00
|
|
|
}
|
|
|
|
\value{
|
|
|
|
A \code{apexcharts} \code{htmlwidget} object.
|
|
|
|
}
|
|
|
|
\description{
|
|
|
|
Colors
|
|
|
|
}
|
2018-09-03 23:52:53 +02:00
|
|
|
\note{
|
|
|
|
See \url{https://apexcharts.com/docs/options/colors/}
|
|
|
|
}
|
2019-06-24 15:18:38 +02:00
|
|
|
\examples{
|
|
|
|
|
|
|
|
library(dplyr)
|
|
|
|
data("diamonds", package = "ggplot2")
|
|
|
|
|
|
|
|
# Change default color(s)
|
|
|
|
apex(
|
|
|
|
data = count(diamonds, cut),
|
|
|
|
mapping = aes(x = cut, y = n)
|
|
|
|
) \%>\%
|
|
|
|
ax_colors("#F7D358")
|
|
|
|
|
|
|
|
|
2019-11-26 10:34:01 +01:00
|
|
|
library(scales)
|
2019-06-24 15:18:38 +02:00
|
|
|
apex(
|
|
|
|
data = count(diamonds, cut, color),
|
|
|
|
mapping = aes(x = cut, y = n, fill = color)
|
|
|
|
) \%>\%
|
2019-11-26 10:34:01 +01:00
|
|
|
ax_colors(brewer_pal(palette = "Set2")(7))
|
2019-06-24 15:18:38 +02:00
|
|
|
}
|