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)
)
Run the code above in your browser using DataLab