The current theme is automatically applied to any plot created with ggcharts. It does not affect plots created with ggplot2.

ggcharts_get_theme()

ggcharts_set_theme(theme, ...)

Arguments

theme

character. The name of the theme, e.g. "theme_hermit"

...

Additional argument passed onto the specified theme

Value

ggchart_set_theme invisibly returns the name of the previously active theme as a character. ggchart_get_theme returns the name of the currently active theme as a character.

Examples

data("diamonds", package = "ggplot2") ## By default `theme_ggcharts()` is used ggcharts_get_theme()
#> [1] "theme_ggcharts"
bar_chart(diamonds, cut)
ggcharts_set_theme("theme_hermit") bar_chart(diamonds, cut)
ggcharts_set_theme("theme_ng") bar_chart(diamonds, cut)
ggcharts_set_theme("theme_nightblue", base_size = 18, base_family = "serif") bar_chart(diamonds, cut)
## Restore the default ggcharts_set_theme("theme_ggcharts")