library(plotly)
ds <- data.frame(labels = c("A", "B", "C"), values = c(10, 40, 60))
plot_ly(ds, labels = labels, values = values, type = "pie") %>%
layout(title = "Basic Pie Chart using Plotly")
我想删除在饼图上显示的百分比标签。
答案 0 :(得分:1)
根据R chart attribute reference,您必须将textinfo
属性设置为none
。
plot_ly(ds, labels = labels, values = values, type = "pie", textinfo = "none")
答案 1 :(得分:0)
这应该做:
library(plotly)
ds <- data.frame(labels = c("A", "B", "C"), values = c(10, 40, 60))
plot_ly(ds, labels = labels, values = values, type = "pie", textinfo= "text", text="") %>%
layout(title = "Basic Pie Chart using Plotly")
如果您想标记,可以在text =&#34;&#34;。
中填写信息