v_specs_legend | R Documentation |
Set legend options
v_specs_legend(vc, ..., add = FALSE)
vc |
An htmlwidget created with |
... |
Options for the legend, see examples or online documentation. |
add |
Add the legend to exiting ones or overwrite all previous legends. |
A vchart()
htmlwidget
object.
library(vchartr)
data("mpg", package = "ggplot2")
vchart(table(Class = mpg$class, Year = mpg$year)) %>%
v_bar(aes(Class, Freq, fill = Year)) %>%
v_specs_legend(
title = list(text = "Title", visible = TRUE),
orient = "right",
position = "start",
item = list(focus = TRUE)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.