[Tex/LaTex] How to create a Gantt chart


I want to create the following picture in LaTeX. I did search a lot but I didn't find anything about Gantt chart.

enter image description here

Best Answer

I think a Gantt Chart is the way to go by looking at your example, using the pgfgantt package. I don't make them as fancy as your example, but I believe you can get quite close with solely using this package. As an example, here is the Gantt Charts I quickly define for projects: enter image description here

I think I spent about one hour creating the 'template' for this setup and to adjust it for a current project, filling it requires about ten minutes of work. However, making one as beautiful as you listed would require a lot more time in creating a nice template instead of the basic one I showed here. Perhaps using a combination of pgfgantt and tikz will get you there, but I can't help you further than that.

Maybe you'll spend a long time defining a beautiful template, but once you got it down it's easy to use for future projects.

Edit : Code of my example

As requested in the comments, here is the code I used for my Gantt Chart. The type of bars and such are defined in the preamble. I defined the grid and general layout in the options of the ganttchart command ( \begin{ganttchart}[options] ). Afterwards I just fill the grid with bars, and then I link them all up.

It's a pretty basic setup, but it lets me use dates to insert into the grid which (in my case) is really useful as I usually have the dates written somewhere else on a timeline. Then I link the right elements and draw a group above elements that belong together (in the example, the orange, blue and green lines).

So whenever I make a new gantt chart I have the same code listed here without anything between \begin{ganttchart}[options] and \end{ganttchart}, then I adjust the grid's date to match mine, and then I start filling it with bars, links and groups.


%Used to draw gantt charts, which I will use for the calendar.
%Let's define some awesome new ganttchart elements:
        inner sep=0pt,
        very thick,
        top color=white,
        bottom color=orange!80
    orangebar label font=\slshape,
    orangebar left shift=.1,
    orangebar right shift=-.1

        inner sep=0pt,
        very thick,
        top color=white,
        bottom color=blue!80
    bluebar label font=\slshape,
    bluebar left shift=.1,
    bluebar right shift=-.1

        inner sep=0pt,
        very thick,
        top color=white,
        bottom color=green!80
    greenbar label font=\slshape,
    greenbar left shift=.1,
    greenbar right shift=-.1

    hgrid style/.style={black, dotted},
    vgrid={*5{black,dotted}, *1{white, dotted}, *1{black, dashed}},
    x unit=3mm,
    y unit chart=9mm,
    y unit title=12mm,
    time slot format=isodate,
    group label font=\bfseries \Large,
    link/.style={->, thick}
    \gantttitlecalendar{year, month=name, week}\\

        group/.append style={fill=orange}
    ]{IMKL Reader}{2014-09-22}{2014-11-9}\\ [grid]
    ]{Documentation}{2014-09-23}{2014-09-23}\\ [grid]
    ]{FME Tutorial}{2014-09-24}{2014-09-26}\\ [grid]
    \ganttlinkedorangebar{}{2014-10-28}{2014-10-31}\\ [grid]
    \ganttlinkedorangebar{}{2014-11-4}{2014-11-7} \ganttnewline[thick, black]

        group/.append style={fill=blue}
    ]{Test Cases}{2014-10-27}{2014-11-9}
        group/.append style={fill=blue}
    ]{}{2014-11-17}{2014-12-19}\\ [grid]
    \ganttbluebar{Innocent testing}{2014-10-30}{2014-10-31}
    \ganttlinkedbluebar{}{2014-12-9}{2014-12-10}\\ [grid]
    \ganttbluebar{Test Case Testing}{2014-11-6}{2014-11-7}
    \ganttlinkedbluebar{}{2014-12-16}{2014-12-16}\\ [grid]
    \ganttlinkedbluebar{}{2014-12-16}{2014-12-16}\ganttnewline[thick, black]

        group/.append style={fill=green}
    ]{KLIP Manager}{2014-11-3}{2014-11-9}
        group/.append style={fill=green}
    ]{}{2014-11-17}{2014-11-23}\\ [grid]

    %Implementing links
    \ganttlink[link mid=0.75]{Documentation}{FME}