6

Let's look at one of the example Gantt charts from the documentation:

\documentclass{standalone}
\usepackage{pgfgantt}

\begin{document}
\begin{ganttchart}[vgrid, hgrid, inline]{12}
\gantttitle{Title}{12} \\
\ganttbar{Task 1}{1}{3}
\ganttbar[bar label inline anchor/.style=above]{Task 2}{5}{10} \\
\ganttbar[bar label shape anchor=left,%
bar label inline anchor/.style=right]{Task 3}{2}{7}
\ganttbar[inline=false]{Final task}{11}{12}
\end{ganttchart}
\end{document}

Which looks like this: enter image description here

How can I move the label of Task 2 a bit up?

1 Answer 1

5

Based on the commands listed in the manual -- pgfgantt Package Wolfgang Skala, v4.0, 2013/06/01, on page 25. There are two commands for label locations.

bar inline label anchor =<anchor>      --- east, west, north, south
bar inline label node/.style=<options> --- above, below, right, left, or = xxpt

x bar label shape anchor=left, -- this causes error in this latest version.

enter image description here

Code

\documentclass[border=10pt]{standalone}

\usepackage{pgfgantt}
%\usetikzlibrary{positioning}
\begin{document}
\begin{ganttchart}[vgrid, hgrid, inline,]{1}{12}
\gantttitle{2014}{12} \\
\ganttbar{Task 1}{1}{3}
\ganttbar[bar inline label node/.style={above=3pt}, %< -- adjust the 3pt 
]{Task 2}{5}{10} \\
\ganttbar[
bar inline label node/.style={left}]{Task 3}{2}{7}
\ganttbar[inline=false]{Final task}{11}{12}
\end{ganttchart}
\end{document}

You must log in to answer this question.

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