LaTeX - Gantt Chart

Table of Contents

Introduction

Today, I found an interesting \(\LaTeX\) package, pgfgantt. This package provides a ganttchart environment and, as its name indicates, can produce Gantt charts.

Usage

The framework of using the package can be illustrated as

\usepackage{pgfgantt}
...
\begin{ganttchart}[OPTIONS]{STARTING}{ENDING}
  TITLE
  CHARTELEMENT
\end{ganttchart}

where

  • OPTIONS can be
    • time slot format with candidates: simple / isodate / isodate-yearmonth / isodate-year / little-endian / middle-endian / big-endian.
    • newline shortcut can turn \\ into a new line break, equivalent to \ganttnewline.
    • vgrid / hgrid specifies the presence and appearance of the vertical/horizontal grids.
    • today can indidate the current day/month/year by a vertical rule at the provided time.
    • today label can specify the label for today.
    • inline can put the labels inside the corresponding bars.
    • x unit / y unit
    • x unit title / y unit title
    • x unit chart / y unit chart
    • expand chart can automatically expand the chart horizontally, e.g., \textwidth.
  • STARTING is the starting date of the chart.
  • ENDING is the ending date of the chart.
  • TITLE can be
    • \gantttitle[OPTIONS]{LABEL}{NUMBEROFTIMESLOTS}
    • \gantttitlelist[OPTIONS]{LABELLIST}{LENGTHOFEACHELEMENT} defines a series of \gantttitle in a batch way.
    • \gantttitlecalendar[OPTIONS]{CALENDARLINES} with CALENDARLINES a comma-separated list of lines, e.g., decade, year, month=name/shortname, day, week, weekday=name/shortname, etc.
    • \gantttitlecalendar*[OPTIONS]{STARTING}{ENDING}{CALENDARLINES} is similar to \gantttitlecalendar[OPTIONS]{CALENDARLINES} but constrained to a range defined by STARTING and ENDING.
  • CHARTELEMENT is predefined chart elements as follows.
    • \ganttgroup[OPTIONS]{LABEL}{STARTING}{ENDING} combines several subtasks (bars) into a single task.
    • \ganttbar[OPTIONS]{LABEL}{STARTING}{ENDING} indicates the duration of a task/subtask.
    • \ganttmilestone[OPTIONS]{LABEL}{TIME} signifies a milestone, e.g., the completion of a task.
    • \ganttlinkedgroup[OPTIONS]{LABEL}{STARTING}{ENDING} is similar to \ganttgroup[OPTIONS]{LABEL}{STARTING}{ENDING} but additionally draws a link from the previous element.
    • \ganttlinkedbar[OPTIONS]{LABEL}{STARTING}{ENDING} is similar to \ganttbar[OPTIONS]{LABEL}{STARTING}{ENDING} but additionally draws a link from the previous element.
    • \ganttlinkedmilestone[OPTIONS]{LABEL}{TIME} is similar to \ganttmilestone[OPTIONS]{LABEL}{TIME} but additionally draws a link from the previous element.
  • CHARTELEMENT has an interesting option progress, whose value can be none / today / PERCENTILE.