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}
1
  • 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! Apr 16, 2017 at 10:25

1 Answer 1

5

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}
3
  • Can we rotate the ganttchart?
    – alper
    Dec 22, 2022 at 10:57
  • @alper How exactly? In my answer it is rotated 90 degree counter clockwise by the sideways environment. Remove that environment if you want it unrotated. Dec 23, 2022 at 23:12
  • Thanks I just wanted to unrotate it
    – alper
    Dec 24, 2022 at 7:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .