I am trying to use the \ganttvrule macro from pgfgantt as suggested by Torbjørn T. in response to Vertical lines in pgfgantt, but with no success. This is his MWE:
\documentclass[border=5mm]{standalone}
\usepackage{pgfgantt}
\begin{document}
\begin{ganttchart}[
vgrid,
hgrid,
vrule/.style={very thick, blue},
vrule label font=\bfseries
]{1}{8}
\gantttitle{2018}{8} \\
\ganttbar{}{1}{2} \\
\ganttbar{}{4}{8}
\ganttvrule{day x}{2}
\ganttvrule[
vrule/.append style={red, thin},
vrule offset=.2,
vrule label node/.append style={anchor=north west}
]{day z}{6}
\end{ganttchart}
\end{document}
This should produce the following:

But I get:
I have also tried to incorporate \ganttvrule in my own code, but with similar results.
I am using Overleaf which complains that this is an "undefined control sequence". (Overleaf also complains about the key \bfseries.)
If there are no coding errors the only thing that comes to mind is that Overleaf is not using the latest version of pgfgantt. I have not tried the code in any other editor.

