✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
🐇 Announcing Dash VTK for 3d simulation graphics. Check out the March webinar.

R Stacked Bar y- axis metric

Hello,
when I run this code from your webpage https://plot.ly/r/bar-charts/#stacked-bar-chart

library(plotly)

Animals <- c(“giraffes”, “orangutans”, “monkeys”)
SF_Zoo <- c(20, 14, 23)
LA_Zoo <- c(12, 18, 29)
data <- data.frame(Animals, SF_Zoo, LA_Zoo)

p <- plot_ly(data, x = ~Animals, y = ~SF_Zoo, type = ‘bar’, name = ‘SF Zoo’) %>%
add_trace(y = ~LA_Zoo, name = ‘LA Zoo’) %>%
layout(yaxis = list(title = ‘Count’), barmode = ‘stack’)

How can i get it the y-axis to sum the values instead of count by categories?