library(highcharter)
library(dplyr)
# Sample dataset
<- mtcars %>%
data ::rownames_to_column(var = "car") %>%
tibblemutate(cyl = as.factor(cyl))
# Basic plot
<- highchart() %>%
p hc_add_series(data, type = "scatter", hcaes(x = mpg, y = hp, group = cyl))
%>% hc_title(text = "Default Theme") p
highcharter Themes
Introduction
In this document, we will explore various themes and styles available in highcharter
.
Below are examples of applying different themes to your plot:
Theme Google
%>%
p hc_title(text = "Theme Google") %>%
hc_add_theme(hc_theme_google())
Theme Financial Times
%>%
p hc_title(text = "Theme Financial Times") %>%
hc_add_theme(hc_theme_ft())
Theme Economist
%>%
p hc_title(text = "Theme Economist") %>%
hc_add_theme(hc_theme_economist())
Theme Elementary
%>%
p hc_title(text = "Theme Elementary") %>%
hc_add_theme(hc_theme_elementary())
Theme Simple
%>%
p hc_title(text = "Theme Simple") %>%
hc_add_theme(hc_theme_smpl())
Theme Database
%>%
p hc_title(text = "Theme Database") %>%
hc_add_theme(hc_theme_db())
Theme FFX
%>%
p hc_title(text = "Theme FFX") %>%
hc_add_theme(hc_theme_ffx())
Theme FiveThirtyEight
%>%
p hc_title(text = "Theme FiveThirtyEight") %>%
hc_add_theme(hc_theme_538())
Theme Flat
%>%
p hc_title(text = "Theme Flat") %>%
hc_add_theme(hc_theme_flat())
Theme Flat Dark
%>%
p hc_title(text = "Theme Flat Dark") %>%
hc_add_theme(hc_theme_flatdark())
Theme Chalk
%>%
p hc_title(text = "Theme Chalk") %>%
hc_add_theme(hc_theme_chalk())
Theme Handdrawn
%>%
p hc_title(text = "Theme Handdrawn") %>%
hc_add_theme(hc_theme_handdrawn())
Theme Dark Unica
%>%
p hc_title(text = "Theme Dark Unica") %>%
hc_add_theme(hc_theme_darkunica())
Theme ggplot2
%>%
p hc_title(text = "Theme ggplot2") %>%
hc_add_theme(hc_theme_ggplot2())
Theme Alone
%>%
p hc_title(text = "Theme Alone") %>%
hc_add_theme(hc_theme_alone())
Theme Bloom
%>%
p hc_title(text = "Theme Bloom") %>%
hc_add_theme(hc_theme_bloom())
Theme Gridlight
%>%
p hc_title(text = "Theme Grid Light") %>%
hc_add_theme(hc_theme_gridlight())
Theme Highcharter
%>%
p hc_title(text = "Theme Highcharter") %>%
hc_add_theme(hc_theme_hcrt())
Theme Null
%>%
p hc_title(text = "Theme Null") %>%
hc_add_theme(hc_theme_null())
Theme Monokai
%>%
p hc_title(text = "Theme Monokai") %>%
hc_add_theme(hc_theme_monokai())
Theme Sansignika
%>%
p hc_title(text = "Theme Sansignika") %>%
hc_add_theme(hc_theme_sandsignika())
Theme Sparkline
%>%
p hc_title(text = "Theme Sparkline") %>%
hc_add_theme(hc_theme_sparkline())
%>%
p hc_title(text = "Theme Sparkline VB") %>%
hc_add_theme(hc_theme_sparkline_vb())
Theme Superheroes
%>%
p hc_title(text = "Theme Superheroes") %>%
hc_add_theme(hc_theme_superheroes())
Theme Tufte
%>%
p hc_title(text = "Theme Tufte") %>%
hc_add_theme(hc_theme_tufte())
%>%
p hc_title(text = "Theme Tufte2") %>%
hc_add_theme(hc_theme_tufte2())