bb_legend {billboarder}R Documentation

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"))


[Package billboarder version 0.4.1 Index]