\documentclass{standalone} \usepackage{tikz,pgfplots} \usepackage{siltex} \usetikzlibrary{arrows.meta,positioning,calc,fadings} \pgfplotsset{compat=1.17} \begin{document} \begin{tikzpicture} \pgfmathsetlengthmacro{\xbarvalue}{-3mm} \pgfmathsetlengthmacro{\barwidthvalue}{4mm} \begin{axis}[ xbar=\xbarvalue, bar width=\barwidthvalue, xmin=0, xmax=21, width=85mm, height=80mm, enlarge y limits=0.15, legend style={at={(0.98,0.95)}, anchor=north east,legend columns=-1}, xlabel={Days}, symbolic y coords={Software Development,Hardware Construction,Development Cycle 2,Development Cycle 1,Test Protocol,Feature Definition,Initial Design,Specifications,Problem Description}, ytick=data, ] \addplot[draw=red,fill=red!40] coordinates {(2,Problem Description) (3,Specifications) (3.5,Initial Design) (2.5,Feature Definition) (0.5,Test Protocol) (3,Development Cycle 1) (14,Development Cycle 2) (2,Hardware Construction) (20,Software Development)}; \addplot[draw=blue,fill=blue!40] coordinates {(2,Problem Description) (3,Specifications) (5,Initial Design) (5,Feature Definition) (1,Test Protocol) (3,Development Cycle 1) (11,Development Cycle 2)}; \legend{Time Spend,Time Planned}; \pgfmathsetlengthmacro{\baroffset}{\barwidthvalue+\xbarvalue/2} \pgfmathsetlengthmacro{\smeer}{7mm} \pgfmathsetlengthmacro{\superscriptoffset}{8.5mm} \node (d) at ($(axis cs:3,Development Cycle 1)+(\superscriptoffset,1mm)$) {\textsuperscript{2}}; \coordinate (a) at ($(axis cs:3,Development Cycle 1)-(0.1mm,0mm)+(0mm,\baroffset)$); \coordinate (b) at ($(axis cs:3,Development Cycle 1)-(0.1mm,0mm)-(0mm,\baroffset)$); \fill[white] (a) rectangle ++(\smeer,-\barwidthvalue-1mm); \fill[red!40,path fading=east] (b) rectangle ++(\smeer,1mm); \fill[blue!40,path fading=east] (a) rectangle ++(\smeer,-\barwidthvalue); \draw[white] ($(a)$) -- +(\smeer,0mm) ++(0mm,-\barwidthvalue) -- +(\smeer,0mm); \draw[white] ($(b)$) -- +(\smeer,0mm); \draw[blue,path fading=east] ($(a)$) -- +(\smeer,0mm) ++(0mm,-\barwidthvalue) -- +(\smeer,0mm); \draw[red,path fading=east] ($(b)$) -- +(\smeer,0mm); \node (e) at ($(axis cs:3,Feature Definition)+(\superscriptoffset,1mm)$) {\textsuperscript{1}}; \coordinate (c) at ($(axis cs:2.5,Feature Definition)-(0.1mm,0mm)-(0mm,\baroffset)$); \fill[red!40,path fading=east] (c) rectangle ++(\smeer,1mm); \draw[white] ($(c)$) -- +(\smeer,0mm); \draw[red,path fading=east] ($(c)$) -- +(\smeer,0mm); \draw[blue,path fading=east] ($(c)+(0pt,1mm)$) -- +(\smeer,0mm);% ++(0mm,-\barwidthvalue) -- +(\smeer,0mm); \end{axis} \end{tikzpicture} \end{document}