Skip to content
Prev 179796 / 398502 Next

Gantt chart but slightly different

Beata Czyz wrote:
Hi Beata,
This could be done by replacing the "taskcolors" argument in the 
"gantt.chart" function with an "angle" argument and passing that 
argument to the "rect" function that draws the bars. You could then get 
hatching of different directions instead of colors. Like this:

gantt.chart<-function(x=NULL,format="%Y/%m/%d",xlim=NULL,
 angle=c(45,45,90,90,135,135),
 priority.legend=FALSE,vgridpos=NULL,vgridlab=NULL,vgrid.format="%Y/%m/%d",
 half.height=0.25,hgrid=FALSE,main="",xlab="",cylindrical=FALSE) {

(a great chunk of the gantt.chart function)

 rect(x$starts[x$labels==tasks[i]],topdown[i]-half.height,
   x$ends[x$labels==tasks[i]],topdown[i]+half.height,
   angle=angle[i],border=FALSE)


(the rest of the gantt.chart function)

Jim