[Tex/LaTex] \ganttalignnewline does’t work

pgfgantt

is there a way to break the label of a \gantgroup?
It works for \gantbar, but it seems not in \ganttgroup. Any suggestion?

IT WORKS:

\begin{ganttchart}[
hgrid,
vgrid,
newline shortcut=true,
bar label node/.append style=%
{align=left}
]{1}{6}
\gantttitle{Title}{6} \\
\ganttgroup{Group 1 test}{1}{4}\\
\ganttbar{%
This is a\ganttalignnewline
multi-line text.%
}{1}{3}
\end{ganttchart}

IT DOESN'T:

\begin{ganttchart}[
hgrid,
vgrid,
newline shortcut=true,
bar label node/.append style=%
{align=left}
]{1}{6}
\gantttitle{Title}{6} \\
\ganttgroup{Group 1\ganttalignnewline test}{1}{4}\\
\ganttbar{%
This is a\ganttalignnewline
multi-line text.%
}{1}{3}
\end{ganttchart}

Best Answer

I can confirm that \ganttgroup cannot split strings, although I, just like the author of the original post, tried:

  • Inserting \ganttalignnewline like this:

    \ganttgroup{Group 1\ganttalignnewline test}{1}{4}\

  • Inserting \newline or \\
I sent an email to the author, Wolfgang.

UPDATE:

A temporal solution is this:

\ganttgroup{ \parbox[c][1ex][c]{0.03\textwidth}{Some \\ text} }{2017-04}{2019-03} \\

where you can adjust 0.03\textwidth at your taste. Ugly hack, but it works.

UPDATE 2: From the email of the author of ganttchart (Wolfgang):

the trick is to enable line breaking in the group label, e.g. by specifying group label node/.append style={align=right} as optional argument to \ganttgroup. Consider the following example:

\begin{ganttchart}{1}{12}
\ganttgroup{This is \ganttalignnewline Group 1}{1}{2} %% will not work
\ganttgroup[group label node/.append style={align=right}]{This is \ganttalignnewline Group 2}{1}{7} %works!
\end{ganttchart}