问题
When hovering over a line graph created with ggvis, I see only the first value of a data.frame displayed, regardless of where I move my mouse.
Example:
library(ggvis)
mtcars %>% ggvis(~wt, ~mpg) %>%
layer_lines() %>%
add_tooltip(function(df) df$wt)
I get the value 1.513 now matter where I hover. This problem does not happen when using layer_points
.
来源:https://stackoverflow.com/questions/27671718/ggvis-add-tooltip-showing-only-one-value-for-layer-lines