【发布时间】:2023-03-18 03:25:01
【问题描述】:
我想创建movies 数据集的散点图,当用户滚动一个点时,它将显示电影的标题。使用来自rCharts rNVD3 tooltip customisation 的答案,我写了以下内容:
movies <- data(movies)
p1 <- nPlot(length ~ votes,
group = 'mpaa',
data = movies,
type = 'scatterChart',
#the following line seems to have NO EFFECT:
tooltip = "#!function(item){ return item.title + ' ' + '('+item.year+')'}!#")
#item is not a valid input to the tooltipContent function
p1$chart(tooltipContent = "#! function(key, x, y){
return key + ' '+item.year
} !#")
p1$print("chart3")
p1
如上面的嵌入式 cmets 中所述,这些自定义工具提示的尝试都不适合我。
【问题讨论】: