remove trace information and control mouse over information of waterfalls plot with ggplotly

34 views Asked by At

is there a way to control the mouse-over information in ggplotly when the chart is generated by the waterfalls::waterfall function?

The default behaviour seems to be to add both the trace information (which is irrelevant in this case) and the x and y coordinates of the center of the bar.

What i would like is to hide the trace information and add the category and the value instead.

library(waterfalls)
library(ggplotly)

df <- data.frame(category = letters[1:5],
                 value = c(100, -20, 10, 20, 110))

g <- waterfall(df,  calc_total = TRUE) +
  theme_classic()

ggplotly(g)

I tried using something like ggplotly(g, tooltip = "x") but the mouse-over trace information was still present and the mouse-over label just contained the category's value.

0

There are 0 answers