[Tex/LaTex] How to customize Tikz Gantt chart

bar chartchartspgfgantttikz-pgf

I am trying to find a way to obtain the following using tikz (actually using pgfgantt):

enter image description here

The code I have so far is:

\documentclass[tikz]{standalone}
\usepackage{pgfgantt}
\begin{document}
\begin{ganttchart}[ hgrid, group progress label node/.append style={below=3pt} ]{1}{12} 
\ganttbar[]{Devices On}{3}{11} \\
\ganttbar[]{Lights On}{1}{12}\\
\gantttitle{Daily Working Time}{12}
\end{ganttchart}
\end{document}

For what I obtain:

Gantt Image obtained with Overleaf

How to obtain nearly the exact result?

Best Answer

One suggestion. The colors of the bars can be changed by modifying the bar style in the optional argument to \ganttbar. For the Daily working time I suggest adding it as a label to the canvas instead of as an element in the chart, that way you don't need any additional work to remove the lines and reduce the height of the box surrounding the bars.

\documentclass[tikz,border=3mm]{standalone}
\usepackage{pgfgantt}
\begin{document}
\begin{ganttchart}[
  hgrid,
  group progress label node/.append style={below=3pt},
  canvas/.append style={label=below:Daily working time} ]{1}{12} 
\ganttbar[bar/.append style={draw=orange!50,fill=orange!30}]{Devices On}{3}{11} \\
\ganttbar[bar/.append style={draw=blue!50,fill=blue!30}]{Lights On}{1}{12}
\end{ganttchart}
\end{document}

enter image description here