Chartist.js for R, powered by htmlwidgets. Github repo is here: https://github.com/yutannihilation/chartist
Sample data:
library(chartist)
set.seed(324)
data <- data.frame(
day = paste0("day", 1:20),
A = runif(10, 0, 20),
B = runif(10, 0, 20),
C = runif(10, 0, 20),
D = runif(10, 0, 20),
E = runif(10, 0, 20),
stringsAsFactors = FALSE
)
Now you can add animations for bar!
chartist(data, day) +
Bar(stackBars = TRUE) +
SVG_animate(target = "bar", offset = -1000, style = "y1", delay = 10) +
SVG_animate(target = "bar", offset = -1000, style = "y2", delay = 10)
But the Bar animation feature still needs to be improved; for example, it seems very odd when you specify only y1…
chartist(data, day) +
Bar(stackBars = TRUE) +
SVG_animate(target = "bar", offset = -50, style = "y1", delay = 10)