I want to generate a grouped bar chart with plotly.
Here is the data:
df <- data.frame(structure(list(Animals = structure(c(1L, 1L, 1L, 3L, 3L, 3L,
2L, 2L, 2L), .Label = c("giraffes", "monkeys", "orangutans"), class = "factor"),
name = c("SF_Zoo", "LA_Zoo", "DC_Zoo", "SF_Zoo", "LA_Zoo",
"DC_Zoo", "SF_Zoo", "LA_Zoo", "DC_Zoo"), value = c(20, 12,
6, 14, 18, 14, 23, 29, 25)), .Names = c("Animals", "name",
"value"), class = c("tbl_df", "tbl", "data.frame"), row.names = c(NA,
-9L)))
The expected render is
I can generate the plot with pivot_wider data and with ggplot2 but need to render it with plotly and in "pivot_longer" format for large data dashboard integration.