bb_legend | R Documentation |
Add legend parameters
bb_legend(bb, ...)
bb |
A |
... |
Arguments defined in https://naver.github.io/billboard.js/release/latest/doc/Options.html#.legend. |
A billboard
htmlwidget
object.
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"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.