0

The gantt chart I created in Latex does not seem to compile?

\documentclass[final]{nbsreport}
\begin{sideways}
\newganttchartelement{voidbar}{
    voidbar/.style={
        draw=black,
        top color=black!25,
        bottom color=black!23
    }}
    \begin{ganttchart}[x unit=0.42cm, 
        y unit title=0.7cm,
        y unit chart=0.7cm, vgrid, title label font=\footnotesize,
        canvas/.style={draw=black, dotted}]{1}{28}
        \gantttitle{Days}\\
        \gantttitlelist{0,5,10,15,20,25,30,35,40,45,50,55,60,65}{2} \\

        \ganttbar{A.Project Assigned}{1}{2}     \\ 
        \ganttbar{B. Create Plan}{3}{6}    \\   
        \ganttbar{C. Ambassador Requirements}{7}{8}              \\ 
        \ganttbar{D. Contact Possible Ambassadors} {9}{12} \\
        \ganttbar{E. Recruit Ambassadors} {13}{16} \\
        \ganttbar{F. Communicate with Ambassadors } {17}{20} \\
        \ganttbar {G. Set Marketing Objectives} {7}{8} \\
        \ganttbar {H. Design, publish \& evaluate survey} {9}{12} \\
        \ganttbar {I. Design Marketing Comms} {13}{16} \\
        \ganttbar {J. Execute Plan} {16}{21} \\
        \ganttbar {K. Set Webpage Objectives} {7}{7} \\
        \ganttbar {L. Website Research} {8}{11} \\
        \ganttbar {M. Website Prototype} {12}{14} \\
        \ganttbar {N. Approve design/develop} {15}{16} \\
        \ganttbar {O. Test \& evaluate} {17}{20} \\
        \ganttbar {P. Venue \& theme} {21}{24} \\
        \ganttbar {Q. Choose Catering \& Entertainment } {25}{28} \\
        \ganttbar {R. Final Presentation} {28}{28} \\
    \end{ganttchart}
\end{sideways}
  • If the class uses pgfgantt: AFAIK \gantttitle has two mandatory arguments. In your example \\ after \gantttitle{Days} would become the second argument. But the second argument has to be a number! – Schweinebacke Apr 16 '17 at 10:25
3

No, because you have the wrong syntax for \gantttitle. If you look in the manual you'll see that the correct syntax is

\gantttitle[<options>]{<label>}{<number of time slots>}

i.e. it has two mandatory arguments, while you have only provided one, the <label>. The second mandatory argument is the number of time slots the title should span, presumably you want it to span the whole chart, and you have 28 timeslots, so you should have

\gantttitle{Days}{28}\\

Complete code (I would reduce y unit chart a bit):

\documentclass{article}
\usepackage{pgfgantt,rotating}
\begin{document}
\begin{sideways}
\newganttchartelement{voidbar}{
    voidbar/.style={
        draw=black,
        top color=black!25,
        bottom color=black!23
    }}
    \begin{ganttchart}[x unit=0.42cm, 
        y unit title=0.7cm,
        y unit chart=0.5cm, vgrid, title label font=\footnotesize,
        canvas/.style={draw=black, dotted}]{1}{28}
        \gantttitle{Days}{28}\\
        \gantttitlelist{0,5,10,15,20,25,30,35,40,45,50,55,60,65}{2} \\

        \ganttbar{A.Project Assigned}{1}{2}     \\ 
        \ganttbar{B. Create Plan}{3}{6}    \\   
        \ganttbar{C. Ambassador Requirements}{7}{8}              \\ 
        \ganttbar{D. Contact Possible Ambassadors} {9}{12} \\
        \ganttbar{E. Recruit Ambassadors} {13}{16} \\
        \ganttbar{F. Communicate with Ambassadors } {17}{20} \\
        \ganttbar {G. Set Marketing Objectives} {7}{8} \\
        \ganttbar {H. Design, publish \& evaluate survey} {9}{12} \\
        \ganttbar {I. Design Marketing Comms} {13}{16} \\
        \ganttbar {J. Execute Plan} {16}{21} \\
        \ganttbar {K. Set Webpage Objectives} {7}{7} \\
        \ganttbar {L. Website Research} {8}{11} \\
        \ganttbar {M. Website Prototype} {12}{14} \\
        \ganttbar {N. Approve design/develop} {15}{16} \\
        \ganttbar {O. Test \& evaluate} {17}{20} \\
        \ganttbar {P. Venue \& theme} {21}{24} \\
        \ganttbar {Q. Choose Catering \& Entertainment } {25}{28} \\
        \ganttbar {R. Final Presentation} {28}{28} \\
    \end{ganttchart}
\end{sideways}
\end{document}

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.