0

I have a very basic question concerning the package pgfgantt.

Take the following MWE:

\documentclass{article}

\usepackage{pgfgantt}

\begin{document}

\begin{ganttchart}[vgrid=true,hgrid=true]{1}{12}
\gantttitlelist{1,...,12}{1} \\
\ganttbar{Bla}{1}{6} \ganttnewline
\ganttmilestone{Bla 1}{6} 
\end{ganttchart}

\end{document}

That is, the output should look as follows:

Month  | 1 | 2 ! 3 | ...
Bla    |   |   |   | ...
Bla 1  |   |   |   | ...

How can I get the word "Month" on the right of the number 1?

Thanks a lot for your feedbacks.

Kolmin
  • 559
  • Which '1' do you mean, the first number of the sequence, or the 'Bla 1'? Where exactly do you want the word 'Month'? As in 1 Month|2|3|...? – Marijn Sep 07 '17 at 09:48
  • Sorry, I mean the first number of the sequence: it should act as an explanation that the sequence concerns the months. – Kolmin Sep 07 '17 at 09:50

1 Answers1

2

As described in How do I add a legend to a pgfgantt chart using the \node command?, you can add a custom node to the current bounding box, which is the border of the chart at that point (including titles and other text).

In the MWE below the east (right) of the new node is positioned west (left) of the bounding box. West is center left, which in the MWE below is left of the first line (because only the first line is drawn at that point, meaning that the bounding box only consists of that line).

Code:

\documentclass{article}
\usepackage{pgfgantt}
\begin{document}
\begin{ganttchart}[vgrid=true,hgrid=true]{1}{12}
\gantttitlelist{1,...,12}{1} \\
\node (a) [anchor=east] at (current bounding box.west){\textit{Months}};
\ganttbar{Bla}{1}{6} \ganttnewline
\ganttmilestone{Bla 1}{6}
\end{ganttchart}
\end{document}

Result:

enter image description here

Marijn
  • 37,699