3

I have a pgfganttchart in a document I made 2 years ago, which then certainly compiled fine. But now, upon compiling, the contents of the chart are moved left of the frame.

Did something change in the library? And how do I fix this code to display nicely again?

The code:

    \begin{ganttchart}[vgrid, hgrid, x unit=0.23cm]{48}{48}
        \gantttitlelist{2014,2015,2016,2017}{12}\\
        \gantttitlelist{1,2,3,4,1,2,3,4,1,2,3,4,1,2,3,4}{3}\\
        \ganttbar{Publiceren*}{4}{4} \ganttbar{}{9}{9} \ganttbar{}{14}{14} \ganttbar{}{21}{21} \ganttbar{}{25}{25} \ganttbar{}{30}{30} \ganttbar{}{38}{38} \ganttbar{}{43}{43} \\
        \ganttbar{Reflexen\mydagger}{1}{3} \\
        \ganttbar{Plaatsing\mydagger}{5}{8} \\
        \ganttbar{Tast\mydagger}{22}{24} \\
        \ganttmilestone{Ruw terrein\mydagger}{24} \\
        \ganttbar{Hardware}{10}{13} \\
        \ganttbar{Controle-strategie\"en}{15}{20} \\
        \ganttbar{Reflexen}{26}{29} \\
        \ganttbar{Plaatsing}{31}{37} \\
        \ganttbar{Tast}{39}{42} \\
        \ganttmilestone{Prototype}{42} \\
        \ganttbar{Proefschrift}{44}{48}

        \ganttlink{elem8}{elem9}
        \ganttlink{elem9}{elem10}
        \ganttlink{elem10}{elem11}
        \ganttlink[link mid=.11]{elem8}{elem12}
        \ganttlink{elem9}{elem12}
        \ganttlink{elem12}{elem13}
        \ganttlink{elem13}{elem14}
        \ganttlink{elem14}{elem15}
        \ganttlink{elem15}{elem16}
        \ganttlink{elem16}{elem17}

        \ganttlink[link mid=.01]{elem8}{elem14}
        \ganttlink[link mid=.01]{elem9}{elem15}
        \ganttlink[link mid=.95]{elem10}{elem16}
    \end{ganttchart}

Problematic Gantt chart

  • 3
    Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. – yo' Mar 11 '15 at 12:05
5

You have the grid defined incorrectly. I do not know this package so I cant answer your concern about changes in the past. Please read its manual as this should be documented then.

% arara: pdflatex

\documentclass[border=2mm]{standalone}
\usepackage[dutch]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{pgfgantt}
\newcommand*{\mydagger}{\ensuremath{^\dagger}}

\begin{document}
\begin{ganttchart}[vgrid, hgrid, x unit=0.23cm]{1}{48}
    \gantttitlelist{2014,2015,2016,2017}{12}\\
    \gantttitlelist{1,2,3,4,1,2,3,4,1,2,3,4,1,2,3,4}{3}\\
    \ganttbar{Publiceren*}{4}{4} \ganttbar{}{9}{9} \ganttbar{}{14}{14} \ganttbar{}{21}{21} \ganttbar{}{25}{25} \ganttbar{}{30}{30} \ganttbar{}{38}{38} \ganttbar{}{43}{43} \\
    \ganttbar{Reflexen\mydagger}{1}{3} \\
    \ganttbar{Plaatsing\mydagger}{5}{8} \\
    \ganttbar{Tast\mydagger}{22}{24} \\
    \ganttmilestone{Ruw terrein\mydagger}{24} \\
    \ganttbar{Hardware}{10}{13} \\
    \ganttbar{Controle-strategieën}{15}{20} \\
    \ganttbar{Reflexen}{26}{29} \\
    \ganttbar{Plaatsing}{31}{37} \\
    \ganttbar{Tast}{39}{42} \\
    \ganttmilestone{Prototype}{42} \\
    \ganttbar{Proefschrift}{44}{48}

    \ganttlink{elem8}{elem9}
    \ganttlink{elem9}{elem10}
    \ganttlink{elem10}{elem11}
    \ganttlink[link mid=.11]{elem8}{elem12}
    \ganttlink{elem9}{elem12}
    \ganttlink{elem12}{elem13}
    \ganttlink{elem13}{elem14}
    \ganttlink{elem14}{elem15}
    \ganttlink{elem15}{elem16}
    \ganttlink{elem16}{elem17}

    \ganttlink[link mid=.01]{elem8}{elem14}
    \ganttlink[link mid=.01]{elem9}{elem15}
    \ganttlink[link mid=.95]{elem10}{elem16}
\end{ganttchart}    
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.