Hmmm, doesn't look like there are any ways to do this in the package directly. It's relatively easy to make it possible though. It does require modifying the package and to be honest I haven't tested the effect it has on linking, grouping, progress, etc. Although if there are problems they can be fixed in a similar manner. First we need to add an option key to affect linespacing. At the beginning of the sty file you will see a lot of keydefs, we add ours here. Lets call the key linespacing.
\@gtt@keydef{linespacing}
Then we add it to ganttset
to ensure it's set to 1 by default. Just add linespacing=1,
in the list. Now for the actual modifications we go to the ganttbar
command. Here we have definitions for y@upper
and y@lower
these determine the dimensions of the bars. We modify them as follows:
\def\y@upper{\@gtt@get{linespacing}*\value{gtt@currentline}%
+\value{gtt@lasttitleline}-\@gtt@get{linespacing}*\value{gtt@lasttitleline}%
-\@gtt@get{bar top shift}}%
\def\y@lower{\@gtt@get{linespacing}*\value{gtt@currentline}%
+\value{gtt@lasttitleline}-\@gtt@get{linespacing}*\value{gtt@lasttitleline}%
-\@gtt@get{bar top shift}-\@gtt@get{bar height}}%
All we do is scale the newlines that are not in the title by the factor we assigned to linespacing
.
You should note that changing a package in this way, especially without checking all the options like I have done here, is not recommended. It can give you a quick way to obtain what you want though. You should never modify the original package, make a copy, place it in your local tex tree and modify that, call it mypgfgantt.sty and include that instead.
Now you can create a picture with less linespacing as follows:
\documentclass[a4paper,11pt]{article}
\usepackage{mypgfgantt}
\begin{document}
\begin{tikzpicture}
\begin{ganttchart}[bar={fill=red!50}]{5}
\gantttitle{2012--2017}{5} \\
\gantttitlelist{1,...,5}{1} \\
\ganttbar{PhD1}{1}{3.5} \\
\ganttbar{PhD2}{2.5}{5} \\
\end{ganttchart}
\end{tikzpicture}
%
\begin{tikzpicture}
\begin{ganttchart}[bar={fill=red!50},linespacing=0.5]{5}
\gantttitle{2012--2017}{5} \\
\gantttitlelist{1,...,5}{1} \\
\ganttbar{PhD1}{1}{3.5} \\
\ganttbar{PhD2}{2.5}{5} \\
\end{ganttchart}
\end{tikzpicture}
\end{document}
This is my first posting here, hope it's up to standards and this (kind of) solves your problem.