Learn R Programming

plotrix (version 1.2-2)

gantt.chart: Display a Gantt chart

Description

Displays a Gantt chart with priority coloring

Usage

gantt.chart(x=NULL,format="%Y/%m/%d",xlim=NULL,taskcolors=NULL,
  main="",ylab="")

Arguments

x
a list of task labels, start/end times and task priorities as returned by get.gantt.info.
format
the format to be used in entering dates/times (see strptime).
xlim
the horizontal limits of the plot.
taskcolors
a vector of colors used to illustrate task priority.
main
the title of the plot - note that this is actually displayed using mtext.
ylab
vertical axis label - usually suppressed.

Value

  • The list used to create the chart. This can be saved and reused rather than manually entering the information each time the chart is displayed.

See Also

get.gantt.info, axis.POSIXct.tickpos

Examples

Run this code
Ymd.format<-"%Y/%m/%d"
 gantt.info<-list(labels=
  c("First task","Second task","Third task","Fourth task","Fifth task"),
  starts=
  as.POSIXct(strptime(
  c("2004/01/01","2004/02/02","2004/03/03","2004/05/05","2004/09/09"),
  format=Ymd.format)),
  ends=
  as.POSIXct(strptime(
  c("2004/03/03","2004/05/05","2004/05/05","2004/08/08","2004/12/12"),
  format=Ymd.format)),
  priorities=c(1,2,3,4,5))
 gantt.chart(gantt.info,main="Calendar date Gantt chart")

Run the code above in your browser using DataLab