Packages and data used below:
library(apexcharter) library(dplyr) data("diamonds", package = "ggplot2") n_cut <- dplyr::count(diamonds, cut)
apex(data = n_cut, type = "column", mapping = aes(x = cut, y = n)) %>% ax_title(text = "Cut distribution")
You can set some options, for example:
apex(data = n_cut, type = "column", mapping = aes(x = cut, y = n)) %>% ax_title( text = "Cut distribution", align = "center", style = list(fontSize = "22px") )
Full list of parameters is available here : https://apexcharts.com/docs/options/title/
apex(data = n_cut, type = "column", mapping = aes(x = cut, y = n)) %>% ax_title(text = "Cut distribution") %>% ax_subtitle(text = "Data from ggplot2")
With same options than for title:
apex(data = n_cut, type = "column", mapping = aes(x = cut, y = n)) %>% ax_title( text = "Cut distribution", align = "center", style = list(fontSize = "22px") ) %>% ax_subtitle( text = "Data from ggplot2", align = "center", style = list(fontSize = "16px", color = "#BDBDBD") )
Full list of parameters is available here : https://apexcharts.com/docs/options/subtitle/