ggvis add_tooltip showing only one value for layer_lines

匆匆过客 提交于 2019-12-08 10:52:33

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!