[Tex/LaTex] Two-line labels in ganttchart


Is there any possibility to set up ganttchart with two-lines labels?

    \gantttitlelist{1,...,12}{1} \\

Two-line labels in ganttchart

Best Answer

As described in Manual/automatic line breaks and text alignment in TikZ nodes there are various ways of having line breaks in nodes. The first suggestion, with tabular, will work directly in your case I'd think. If you want to use the second or third method, you need to modify the bar inline label node style, as you're using the inline option. (Otherwise it would be bar label node.)

I think you need to change the bar height manually though, if you want the bar to be taller, so use

\ganttbar[bar height=1]{two\\lines}{1}{2} \\

bar label with two lines

  bar inline label node/.append style={
    \gantttitlelist{1,...,12}{1} \\
    \ganttbar[bar height=1]{two\\lines}{1}{2} \\