使用下面的代码使用Highcharts在闪亮的R界面中制作饼图,但无法命名切片。我使用了从我的app文件夹中以csv格式存储的数据集。
output$Hist<-renderHighchart({
data<-read.csv(paste0(getwd(),"/data.csv"),header=TRUE,stringsAsFactors=FALSE)
highchart() %>%
hc_chart(type = "pie") %>%
hc_plotOptions(
series = list(showInLegend = TRUE)
) %>%
hc_add_series(data = data$Count, name = data$X) %>%
hc_tooltip(valueDecimals = 0,
pointFormat = "Count: {point.y}") %>%
hc_legend(enabled = TRUE)%>%