rCharts nplot 饼图,关闭 legend/toggle 按钮

rCharts nplot piechart, turn off legend/toggle buttons

鉴于:

df <- data.frame(var = letters[1:26], count = sample(1:300, 26),
                 label = sample(toupper(letters[1:5]), 26, replace = T))
library(rCharts)

p4 <- nPlot(count ~ var, data = df, type = 'pieChart',
            width = 500, height=500)
p4$chart(tooltipContent = "#! function(x, y){ 
  return 'Type: ' + x + '<br>Count: ' + y
} !#")
p4

我可以转off/remove顶部的图例吗?或者将它从顶部移动到 left/right?

我会 post 我自己的答案,所以这个问题已经结束。

p4$chart(showLegend = FALSE)