Skip to contents

Sets chart theme tokens using CSS custom properties

Usage

setTheme(
  myIO,
  textColor = NULL,
  gridColor = NULL,
  bg = NULL,
  font = NULL,
  mode = NULL,
  preset = NULL,
  overrides = list(),
  ...
)

Arguments

myIO

an htmlwidget object created by the myIO() function

textColor

text and label color

gridColor

grid line color

bg

background color

font

font family

mode

Character or NULL. Theme mode: "light", "dark", or "auto". Default NULL (no mode, manual CSS vars only).

preset

Character or NULL. Named theme preset applied as a complete palette. One of "light", "dark", "midnight", "ocean", "forest", "sunset", "monochrome", "neon", "corporate", "academic", "nature", "minimal", "retro", or "warm". Unrecognized values are ignored. Default NULL.

overrides

Named list of CSS custom property overrides (e.g., list("--chart-tooltip-bg" = "#222")).

...

additional CSS custom property overrides; only names with a -- prefix are applied. Also accepts the deprecated text_color and grid_color aliases for textColor and gridColor. Other names are ignored with a warning.

Value

A modified myIO htmlwidget object with updated theme configuration.

Examples

myIO() |>
  setTheme(textColor = "#222222", gridColor = "#d9d9d9")
myIO() |> setTheme(mode = "dark", bg = "#1a1a2e")