Suppose I have the following graph
library(ggvis)
mtcars%>% ggvis(~factor(cyl)) %>% layer_bars()
How can I add a tooltip with the count variable?
Thanks
This does the trick:
library(ggvis)
mtcars %>% ggvis(~factor(cyl)) %>% layer_bars() %>%
add_tooltip(function(df) (df$stack_upr_ - df$stack_lwr_))