[Tex/LaTex] pgfgantt: Labels not properly centered

horizontal alignmentpgfgantt

I am trying to create a Gantt chart, and found this wonderful package pgfgantt. However, my labels do not get properly centered in the boxes. Am I doing something wrong? Is there a way to get the result I want?
(I looked around for an answer, but could not find it. My apologies if I missed it.)

Here is the code:

\documentclass{standalone}
\usepackage{pgfgantt}
\definecolor{grey}{gray}{0.75}
\begin{document}
\begin{ganttchart}[hgrid, inline, bar height = 1, bar top shift = 0, x unit = .7cm, y unit chart= .4cm]{17}
\ganttbar[bar/.style={fill=grey}]{\ }{0.00000}{1.00000}
\ganttbar{1}{1.00000}{2.00000}
\ganttbar[bar/.style={fill=grey}]{\ }{2.00000}{3.00000}
\ganttbar{4}{3.00000}{8.00000}
\\
\ganttbar[bar/.style={fill=grey}]{\ }{0.00000}{1.00000}
\ganttbar{2}{1.00000}{3.00000}
\ganttbar[bar/.style={fill=grey}]{\ }{3.00000}{4.00000}
\ganttbar{5}{4.00000}{15.00000}
\\
\ganttbar[bar/.style={fill=grey}]{\ }{0.00000}{1.00000}
\ganttbar{3}{1.00000}{4.00000}
\ganttbar[bar/.style={fill=grey}]{\ }{4.00000}{5.00000}
\ganttbar{6}{5.00000}{17.00000}
\end{ganttchart}
\end{document}

I cannot post the resulting pdf, because I'm a new user, but maybe you can still see it here

Best Answer

The alignment is correctly centered, but the ganttbars that you create are overlapping. The numbers in the second and third argument of \ganttbar represent a kind of slot value and are not (x)-coordinates. See the following corrected MWE:

\documentclass{standalone}
\usepackage{pgfgantt}
\definecolor{grey}{gray}{0.75}
\begin{document}
\begin{ganttchart}[hgrid, inline, bar height = 1, bar top shift = 0, x unit = .7cm, y unit chart= .4cm]{17}
\ganttbar[bar/.style={fill=grey}]{}{1}{1} % starts in slot 1, ends in slot 1, width=1 slot
\ganttbar{1}{2}{3}                        % starts in slot 2, ends in slot 3, width=2 slots
\ganttbar[bar/.style={fill=grey}]{}{4}{4} % starts in slot 4, ends in slot 4, width=1 slot
\ganttbar{3}{5}{8.00000}                  % starts in slot 5, ends in slot 8, width=4 slots
 \ganttnewline
\ganttbar[bar/.style={fill=grey}]{}{1}{1}
\ganttbar{2}{2}{3}
\ganttbar[bar/.style={fill=grey}]{}{4}{4}
\ganttbar{5}{5}{15}
 \ganttnewline
\ganttbar[bar/.style={fill=grey}]{}{1}{1}
\ganttbar{3}{2}{4}
\ganttbar[bar/.style={fill=grey}]{}{5}{5}
\ganttbar{6}{6}{17}
\end{ganttchart}
\end{document} 

ganttbar example