我已经使用 nvd3.js 在 rCharts 中构建了一个散点图,并且想关闭放大功能。这可能吗?
代码如下:
output$riskChart <- renderChart({
risk <- nPlot(Return ~ Risk, group = 'Names', data = RiskData(),
type = "scatterChart", dom = 'riskChart', width = 1000, height=400)
risk$chart(size = '#! function(d){return d.Size} !#')
risk$chart(color = c('#c66631', '#317cc6', '#32743a', '#c4c631'),
tooltipContent = "#!function(key, y, e, graph) {
return '<h4>' + key + '</h4>' +
'<p><strong>Risk: </strong>' + y + '<br><strong>Return: </strong>' + e + '</p>';
}!#")
risk$xAxis(axisLabel = 'Risk')
risk$yAxis(axisLabel = 'Return')
return(risk)
})
在此先感谢您的帮助!
最佳答案
只需添加
risk$chart(showControls = FALSE)
关闭控件,包括放大。
关于r - 使用 rCharts、shiny、nPlot 在 nvd3 中关闭散点图上的放大,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20979212/