R/fusionTheme.R

Defines functions fusionTheme

Documented in fusionTheme

#' Adding FusionCharts theme
#'
#' \url{https://www.fusioncharts.com/dev/themes/introduction-to-themes}
#'
#' @import htmlwidgets
#'
#' @param fusionPlot fusionPlot object got by \code{fusionPlot()}
#' @param theme Chart theme
#'
#'
#' @examples
#' library(fusionchartsR)
#' df <- data.frame(label = c("Venezuela", "Saudi", "Canada", "Russia"), value = c(290, 260, 180, 115))
#' df %>%
#'   fusionPlot(x = "label", y = "value", type = "pie2d") %>%
#'   fusionTheme(theme = "gammel")
#'
#' @export
fusionTheme <- function(fusionPlot, theme = c("fusion", "gammel", "candy", "zune", "ocean", "carbon", "umber")) {
  ThemeAttrs <- list()
  ThemeAttrs$theme <- match.arg(theme)
  fusionPlot$x$theme <- ThemeAttrs$theme
  return(fusionPlot)
}
alexym1/fusionchartsR documentation built on Dec. 20, 2024, 10:10 p.m.