Learn R Programming

apexcharter (version 0.4.4)

ax_theme: Theme for charts

Description

Theme for charts

Usage

ax_theme(ax, mode = c("light", "dark"), palette = NULL, monochrome = NULL, ...)

Value

An apexchart()

htmlwidget object.

Arguments

ax

An apexchart() htmlwidget object.

mode

use light or dark theme.

palette

Character. Available palettes: "palette1" to "palette10".

monochrome

A list of parameters.

...

Additional parameters.

Examples

Run this code
data("mpg", package = "ggplot2")
data("diamonds", package = "ggplot2")

# Dark mode
apex(
  data = mpg,
  mapping = aes(x = manufacturer)
) %>% 
  ax_theme(mode = "dark")

# Use predefined palette (1 to 10)
apex(
  data = diamonds,
  mapping = aes(x = color, fill = cut)
) %>% 
  ax_theme(palette = "palette2")

# monochrome palette
apex(
  data = diamonds,
  mapping = aes(x = color, fill = cut)
) %>% 
  ax_theme(monochrome = list(enabled = TRUE, color = "#0B6121"))

Run the code above in your browser using DataLab