Helper for creating a pie chart
Arguments
- bb
A
billboard
htmlwidget
object.- data
A
data.frame
, first column should contain labels, second column values associated, except if mapping is provided.- mapping
Mapping of variables on the chart, see
bbaes
.- ...
Arguments for slot pie, https://naver.github.io/billboard.js/release/latest/doc/Options.html#.pie.
Note
This function can be used with billboarderProxy
in shiny application.
Examples
stars <- data.frame(
package = c("billboarder", "ggiraph", "officer", "shinyWidgets", "visNetwork"),
stars = c(9, 177, 43, 44, 169)
)
# Default
billboarder() %>%
bb_piechart(data = stars)
# Explicit mapping
billboarder() %>%
bb_piechart(data = stars, bbaes(package, stars))
# Other way to specify mapping
billboarder(data = stars) %>%
bb_aes(package, stars) %>%
bb_piechart()