Learn R Programming

billboarder (version 0.5.0)

bb_color: Color property for a Billboard.js chart

Description

Color property for a Billboard.js chart

Usage

bb_color(bb, palette = NULL, ...)

Value

A billboard

htmlwidget object.

Arguments

bb

A billboard htmlwidget object.

palette

A color palette to use with series added in the chart.

...

See https://naver.github.io/billboard.js/release/latest/doc/Options.html#.color

Examples

Run this code

library("RColorBrewer")

# Scatter
billboarder() %>% 
  bb_scatterplot(data = iris, x = "Sepal.Length", y = "Sepal.Width", group = "Species") %>% 
  bb_axis(x = list(tick = list(fit = FALSE))) %>% 
  bb_point(r = 8) %>% 
  bb_color(palette = brewer.pal(n = 3, name = "Reds"))

# Pie
stars <- data.frame(
  package = c("billboarder", "ggiraph", "officer", "shinyWidgets", "visNetwork"),
  stars = c(9, 177, 43, 44, 169)
)
cols <- brewer.pal(n = 5, name = "Dark2")

billboarder() %>%
  bb_piechart(data = stars) %>%
  bb_color(palette = brewer.pal(n = 5, name = "Reds"))

Run the code above in your browser using DataLab