[Tex/LaTex] How to have a two-line label in a gantt chart

pgfgantttikz-pgf

How can I have a two-line label in a gantt chart when the label is outside of the chart (to the left)? This problem was solved when the label is inline with the bar (Two-line labels in ganttchart), but it does not work when the label is the left of the chart.

Thanks for your help.

Best Answer

Are you looking for something like this:

\documentclass{standalone}
\usepackage{pgfgantt}
\begin{document}
\begin{ganttchart}[
    bar label node/.append style=%
    {align=left}
  ]{1}{12}
    \gantttitlelist{1,...,12}{1} \\
    \ganttbar[bar height=1]{two\ganttalignnewline lines}{1}{2} \\
    \ganttbar[bar height=1]{two\\ lines}{1}{2} \\
\end{ganttchart}
\end{document}

enter image description here