03-20-2011
16,
0
Join Date: Dec 2009
Last Activity: 4 August 2011, 8:30 AM EDT
Posts: 16
Thanks Given: 7
Thanked 0 Times in 0 Posts
Automatic generate 3D pie Graph
Hello all,
I need the scripts automatic generate 3D pie Graph. What I have now is as below:
Run at terminal by $ CMD R BATCH graph.R
# 3D Exploded Pie Chart
library(plotrix)
slices <- c(20, 15, 4, 15, 8)
lbls <- c("Media", "Document", "DB", "Others", "Available")
pct <- round(slices/sum(slices)*100)
lbls <- paste(lbls, pct) # add percents to labels
lbls <- paste(lbls,"%",sep="") # ad % to labels
pie3D(slices,labels=lbls,explode=0.1,
main="Storage Profiler ")
But the problem is I need to key in manually in this scripts. For example at:
slices <- c(20, 15, 4, 15, 8)
lbls <- c("Media", "Document", "DB", "Others", "Available")
How about this scripts will read the data from *.csv file
Sample of CSV:
Media,20
Document,15
DB,4
Others,15
Available,8
Last edited by sheikh76; 03-20-2011 at 01:50 PM..
Reason: Forget to do code