有点hacky解决方案,但您可以使用htmlwidgets和Javascript来自己指定游标。
通过d3.select我们获取cursor-crosshair使用该类的所有元素并将光标设置覆盖为默认值,因此所有其他光标都保持不变,例如轴的调整大小光标。
library(plotly)
library(htmlwidgets)
plot_ly(type='bar',
x = c(1, 2),
y = c(3, 5)) %>% onRender("
function(el, x) {
Plotly.d3.select('.cursor-crosshair').style('cursor', 'default')
}
")
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1837 次 |
| 最近记录: |