Plot.ly has a tutorial on this for Python:
# Add original data
x=[\'Winter\', \'Spring\', \'Summer\', \'Fall\']
y0_org=[40, 80, 30, 10]
y1_org=[20, 10, 10,
This is how I got it:
library(plotly)
x <- c('Winter', 'Spring', 'Summer', 'Fall')
y0 <- c(40, 80, 30, 10)
y1 <- c(20, 10, 10, 10)
y2 <- c(40, 10, 60, 80)
y1 <- y0 + y1
y2 <- y1 + y2
p <- ggplot() +
geom_area(aes(x, y2, fill = 'green')) +
geom_area(aes(x, y1, fill = 'blue')) +
geom_area(aes(x, y0, fill = 'red'))
ggplotly(p)