-->

ggvis add_tooltip showing only one value for layer

2019-06-09 18:53发布

问题:

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.

标签: r ggvis