I want Help regarding Data Visualization by ggplot2 or other code
I have more than 50000 observation of sales data
here 49 variable
I want to prepare pie chat and % pie chart with name and waterfall chart with the name in R programming
I tried pie chart but categories overlapped
I want to prepare % pie chart with name Item (more than 30 categories of Items) between Quantity of Item's sale and also want waterfall Chart or bar Chart in R.
please help
# install.packages("ggplot2")
library("ggplot2")
hh<-read.csv(file.choose(),header=T)
attach(hh)
#1st methods
myfreq <- table(hh$Item)
cols <- rainbow(nrow(hh))
pie(myfreq)
barplot(myfreq)
#2nd cols <- rainbow(nrow(hh))
myfreq <- table(hh$Qty,hh$Item)
pie(myfreq)
#3rd Method
df <- data.frame(group = (Item), value = (Qty))
head(df)
bp<- ggplot(df, aes(x="group", y=value, fill=group),color=cols)
bp<- ggplot(df, aes(x="group", y=value),color=cols)
pie <- bp + coord_polar(theta='y')
print(pie)
# I also tried a syntax but syntax is not running
pie(myfreq,labels=paste0(round(myfreq/sum(myfreq)*100,2),'%'),col=cols, legend('bottom',legend=Qty,Item,pch='???',ncol=nrow(hh),bty='n',col=cols))