# How to fill gantt chart bar with arbitrary color

In the code below I would just like to manually decide to fill the second bar in the chart with a color or hash it! I want to be able to decide which bars to make these changes on a case by case basis. I know there are some solutions like Can I have a pgfgantt chart with different colors per bar? but this is not what I want. I simply want to use a single command like "fillbar" on the chart element in question.

\documentclass{article}
\usepackage{pgfgantt}

\begin{document}
\begin{ganttchart}[
hgrid,
vgrid,
time slot format=isodate-yearmonth,
compress calendar
]{2015-12}{2016-05}
\gantttitlecalendar{year, month} \\

\ganttbar{}{2016-02}{2016-03} \\

\end{ganttchart}

\end{document}


The documentation of pgfgantt includes a chapter "Style Examples", starting at page 45.

The syntax for ganttbars is: \ganttbar[ options ]{ label }{ start tss }{ end tss }. You can make different settings for most of the available elements. Also, you can adjust the colour of the bars quite easily:

\ganttbar[bar/.append style={fill=anycolor}]{}{2016-02}{2016-03}


Then your code should look like this:

\begin{ganttchart}[
hgrid,
vgrid,
time slot format=isodate-yearmonth,
compress calendar
]{2015-12}{2016-05}
\gantttitlecalendar{year, month} \\
\ganttbar[bar/.append style={fill=blue}]{}{2016-02}{2016-03}\\

• If you use the progress bar, then it may happen, that you have to adapt bar incomplete (It happened just to me and I wondered why the solution did not work in my case). – knut May 3 '17 at 8:49