data3 <- read.csv("新手教程路径留存人数统计.csv")
data3
data3_ordered <- data3[order(data3$用户数),]
barplot(data3_ordered$用户数,horiz = T,axes=F,border=F,
space=0.5,col="steelblue1",xlim=c(-700,700),main="关键路径漏斗图")
barplot(-data3_order$用户数,horiz=T,add=T,border=F,space=0.5,
axes=F,col="steelblue1")
# 增加步骤名称
text(x=rep(-600,6),y=seq(1,8.5,length.out = 6),
labels=data3_order$事件行为,cex=0.8,font=3,col="black")
# 增加总体的转化率
text(x=rep(0,6),y=seq(1,8.5,length.out = 6),
labels=paste0(round(data3_order$用户数*100/max(data3_order$用户数),2),"%"),
cex=0