Skip to content

Issue with hover value on stacked barplot #557

@Pauline6010

Description

@Pauline6010

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 ?

Thank you very much,
Pauline

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions