【问题标题】:Turn off magnify on scatterChart in nvd3 using rCharts, shiny, nPlot使用 rCharts、闪亮、nPlot 关闭 nvd3 中散点图上的放大
【发布时间】:2014-01-07 18:36:58
【问题描述】:

我已经使用 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)
           })

提前感谢您的帮助!

【问题讨论】:

    标签: r nvd3.js shiny rcharts


    【解决方案1】:

    只需添加

    risk$chart(showControls = FALSE)
    

    关闭控件,包括放大。

    【讨论】:

    • 感谢拉姆纳特!我希望这也能解决工具提示问题,但看起来那个错误仍然存​​在。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-07-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多