Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

bb_legend

Add legend parameters


Description

Add legend parameters

Usage

bb_legend(bb, ...)

Arguments

bb

A billboard htmlwidget object.

...

Arguments defined in https://naver.github.io/billboard.js/release/latest/doc/Options.html#.legend.

Value

A billboard htmlwidget object.

Examples

library("billboarder")

stars <- data.frame(
  package = c("billboarder", "ggiraph", "officer", "shinyWidgets", "visNetwork"),
  stars = c(1, 176, 42, 40, 166)
)

# Hide legend
billboarder() %>%
  bb_barchart(data = stars) %>% 
  bb_legend(show = FALSE)

# Right legend
billboarder() %>%
  bb_piechart(data = stars) %>% 
  bb_legend(position = "right")

# Inset legend
billboarder() %>%
  bb_scatterplot(data = iris, x = "Sepal.Length", y = "Sepal.Width", group = "Species") %>% 
  bb_axis(x = list(tick = list(fit = FALSE))) %>% 
  bb_legend(position = "inset", inset = list(anchor = "top-right"))

billboarder

Create Interactive Chart with the JavaScript 'Billboard' Library

v0.3.1
MIT + file LICENSE
Authors
Victor Perrier [aut, cre], Fanny Meyer [aut], NAVER Corp [cph] (billboard.js library), Mike Bostock [cph] (d3.format library)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.