rCharts nplot piechart,关闭图例/切换按钮

rCharts nplot piechart,关闭图例/切换按钮,r,rcharts,R,Rcharts,鉴于: df我会发布我自己的答案,这样这个问题就结束了 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',

鉴于:


df我会发布我自己的答案,这样这个问题就结束了

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
无需担心:
p4$chart(showLegend=FALSE)
会起作用
p4$chart(showLegend = FALSE)