I am having troubles getting the good value rendered in the hover text with stacked barplot.
Here is a reproducible example :
#data
dataf = data.frame(Espece = c("A","A","B","B","C","C"),
Type = c("A","B","A","B","A","B"),
Value = c(2,2,5,1,6,0))
#ggplot
gg = ggplot(dataf, aes(x = Espece, y = Value, fill = Type)) +
geom_bar(stat = "identity") +
theme(legend.position = "none") +
theme(axis.text.x = element_text(angle = 90, hjust = 1))
#plotly
p <- ggplotly(gg)
p
The value for Espece A, type B is 4 whereas it should be 2. It renders stacked values instead of individual values. Is there a way to fix this ?
I am having troubles getting the good value rendered in the hover text with stacked barplot.
Here is a reproducible example :
The value for Espece A, type B is 4 whereas it should be 2. It renders stacked values instead of individual values. Is there a way to fix this ?
Thank you very much,
Pauline