'In ggplot2 how to add angled label to donut chart
Below code can draw donut chart as the left one in attached image, how to change the label as the right one? Thanks!
library(tidyverse)
pie_data <- data.frame(category=c('A','B','C'),sales=c(70,25,40))
pie_data %>% ggplot(aes(x=1,y=sales,fill=category))+
geom_col()+
scale_fill_brewer(direction = -1)+
geom_text(position=position_stack(vjust=0.5),aes(label=paste0('Category ',category,':',sales)))+
xlim(-1,2)+
coord_polar(theta = 'y')+
theme_void()
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

