Draw Gantt chart LaTeX with pgfgantt

I tried the example given here.

\documentclass{article}
\usepackage{pgfgantt}

\begin{document}

\begin{figure}[ftbp]
\begin{center}

\begin{ganttchart}[y unit title=0.4cm,
y unit chart=0.5cm,
vgrid,hgrid,
title label anchor/.style={below=-1.6ex},
title left shift=.05,
title right shift=-.05,
title height=1,
bar/.style={fill=gray!50},
incomplete/.style={fill=white},
progress label text={},
bar height=0.7,
group right shift=0,
group top shift=.6,
group height=.3,
group peaks={}{}{.2}]{24}
%labels
\gantttitle{Week}{24} \\
\gantttitle{Monday}{4}
\gantttitle{Tuesday}{4}
\gantttitle{Wednesday}{4}
\gantttitle{Thursday}{4}
\gantttitle{Friday}{4}
\gantttitle{Saturday}{4} \\

%relations
\end{ganttchart}
\end{center}
\caption{Gantt Chart}
\end{figure}

\end{document}


I probably forgot to install a package but Tex Live shows that pgfgantt is installed. I get a lot of errors. The first two are:

! LaTeX Error: Unknown float option f'.
! Package pgfkeys Error: I do not know the key '/pgfgantt/group peaks', to whic h you passed '{}{}{.2}', and I am going to ignore it. Perhaps you misspelled it . See the pgfkeys package documentation for explanation. Type H <return> for immediate help.... \gantttitle


Could you help me? Thanks in advance.

• There is no option f for the environment float, remove it.

• The example you are trying uses an old version of pgfgantt. For the current version, 5.0, you have to change three things.

• Remove group peaks={}{}{.2} from the options of ganttchart.
• Replace the parameter {24} of the ganttchart environment by {1}{24}.
• The key incomplete changed to bar incomplete. In the example below, I removed the key, as the current default settings might be what you want anyway.

\documentclass{article}
\usepackage{pgfgantt}

\begin{document}

\begin{figure}[tbp]
\begin{center}

\begin{ganttchart}[y unit title=0.4cm,
y unit chart=0.5cm,
vgrid,hgrid,
title label anchor/.style={below=-1.6ex},
title left shift=.05,
title right shift=-.05,
title height=1,
progress label text={},
bar height=0.7,
group right shift=0,
group top shift=.6,
group height=.3]{1}{24}
%labels
\gantttitle{Week}{24} \\
\gantttitle{Monday}{4}
\gantttitle{Tuesday}{4}
\gantttitle{Wednesday}{4}
\gantttitle{Thursday}{4}
\gantttitle{Friday}{4}
\gantttitle{Saturday}{4} \\

%relations

• Thank you. I didn't see {24} in ganttchart. Mar 15, 2021 at 16:44
• Seems like progress is no longer displayed? Jun 27, 2021 at 13:33
• @TheSimpliFire Thanks for the note. The progress is still displayed but was invisible since the name of the style incomplete changed. In my example, I removed it such it now shows the default styling. Jun 27, 2021 at 13:54
• @gernot I just realised that the now too, and got round it by using bar/.style={fill=blue!50}` Jun 27, 2021 at 13:55