作者:吴淑舜415 | 来源:互联网 | 2023-10-10 10:07
Imtryingtomakeplotwithextravariablesintooltips,butcantunderstandhowtomakeit.Fore
I'm trying to make plot with extra variables in tooltips, but can't understand how to make it.
For example I want to display qsec
, cyl
and hp
columns
Tutorial from API didn't help me
Example :
我正在尝试用工具提示中的额外变量来绘制绘图,但是我不知道如何制作它。例如,我想显示qsec、cyl和hp列教程的API没有帮助我的例子:
library(dplyr)
library(echarts4r)
mtcars %>%
tibble::rownames_to_column("model") %>%
e_charts(wt) %>%
e_scatter(mpg,bind=model) %>%
e_tooltip(formatter = htmlwidgets::JS("
function(params){
return('' + params.name +
'
wt: ' + params.value[0] +
'
mpg: ' + params.value[1] +
'
qsec: ' + this.qsec ) } "))
expected result something like this:
https://github.com/jbkunst/highcharter/issues/54
预期结果如下:https://github.com/jbkunst/highcharter/issues/54
2 个解决方案