在 R 4.2.1 中使用 PieDonut 旋转标签

问题描述 投票:0回答:1

我正在使用 R 4.2.1 制作 PieDonut 图表,甜甜圈标签全部聚集在一起,更改字体大小没有帮助。有没有办法将标签与甜甜圈偏移一定距离?或者旋转它们?

这是我当前的代码:

    PieDonut(data, aes(Category, Detail, count=Amount), title = "June", 
        showRatioDonut = FALSE, showRatioPie = FALSE, pieLabelSize = 3,
        labelposition = 10, labelpositionThreshold = 1, use.label = TRUE,
        donutLabelSize = 3, showRatioThreshold = FALSE)

编辑添加数据:

structure(list(Detail = c("Payroll", "Lab services", "Distribution", 
"Office supplies", "Tech supplies", "Dental supplies", "Loan", 
"Rent", "Taxes", "Processing fees", "Misc", "One time", "Unknown", 
"CDA Dues", "Housekeeping", "CME", "Accounting services", "Utilities", 
"Gas", "Car", "Life insurance", "Insurance", "Lunch"), Category = c("Payroll", 
"Lab", "Distribution", "Supplies", "Supplies", "Supplies", "Loan", 
"Rent", "Taxes", "Misc", "Misc", "Misc", "Misc", "Services", 
"Services", "Services", "Services", "Services", "Car", "Car", 
"Insurance", "Insurance", "Lunch"), Amount = c(55879.8, 18000, 
15000, 1527.7, 3269.96, 8005.54, 9106.06, 6509, 5468, 15, 180.23, 
529.06, 2629.6, 167.92, 250, 448, 550, 590.1, 269.47, 406.99, 
101.47, 719.34, 110.33)), class = "data.frame", row.names = c(NA, 
-23L))
r label pie-chart
1个回答
0
投票

您最终解决了这个问题吗?我也遇到同样的问题,期待向您学习。任何建议都会非常合适。谢谢

© www.soinside.com 2019 - 2024. All rights reserved.