Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

41 lignes
2.0KB

  1. \documentclass{standalone}
  2. \usepackage{tikz,pgfplots}
  3. \usepackage{siltex}
  4. \usetikzlibrary{arrows.meta,positioning,calc,fadings}
  5. \pgfplotsset{compat=1.17}
  6. \begin{document}
  7. \begin{tikzpicture}
  8. \pgfmathsetlengthmacro{\xbarvalue}{-3mm}
  9. \pgfmathsetlengthmacro{\barwidthvalue}{4mm}
  10. \begin{axis}[
  11. xbar=\xbarvalue,
  12. bar width=\barwidthvalue,
  13. xmin=0,
  14. xmax=21,
  15. width=85mm,
  16. height=75mm,
  17. enlarge y limits=0.15,
  18. legend style={at={(0.98,0.95)},
  19. anchor=north east,legend columns=-1},
  20. xlabel={Days},
  21. symbolic y coords={Software Development,Development Cycle 2,Development Cycle 1,Test Protocol,Feature Definition,Initial Design,Specifications,Problem Description},
  22. ytick=data,
  23. ]
  24. \addplot[draw=red,fill=red!40] coordinates {(2,Problem Description) (3,Specifications) (3.5,Initial Design) (13,Feature Definition) (0.5,Test Protocol) (3,Development Cycle 1) (17,Development Cycle 2) (20,Software Development)};
  25. \addplot[draw=blue,fill=blue!40] coordinates {(2,Problem Description) (3,Specifications) (5,Initial Design) (6,Feature Definition) (1,Test Protocol) (3,Development Cycle 1) (13,Development Cycle 2)};
  26. \legend{Time Spend,Time Planned};
  27. \pgfmathsetlengthmacro{\baroffset}{\barwidthvalue+\xbarvalue/2}
  28. \pgfmathsetlengthmacro{\smeer}{7mm}
  29. \node (a) at ($(axis cs:3,Development Cycle 1)-(0.1mm,0mm)+(0mm,\baroffset)$) {};
  30. \node (b) at ($(axis cs:3,Development Cycle 1)-(0.1mm,0mm)-(0mm,\baroffset)$) {};
  31. \fill[white] (a) rectangle ++(\smeer,-\barwidthvalue-1mm);
  32. \fill[red!40,path fading=east] (b) rectangle ++(\smeer,1mm);
  33. \fill[blue!40,path fading=east] (a) rectangle ++(\smeer,-\barwidthvalue);
  34. \draw[white] ($(a)$) -- +(\smeer,0mm) ++(0mm,-\barwidthvalue) -- +(\smeer,0mm);
  35. \draw[white] ($(b)$) -- +(\smeer,0mm);
  36. \draw[blue,path fading=east] ($(a)$) -- +(\smeer,0mm) ++(0mm,-\barwidthvalue) -- +(\smeer,0mm);
  37. \draw[red,path fading=east] ($(b)$) -- +(\smeer,0mm);
  38. \end{axis}
  39. \end{tikzpicture}
  40. \end{document}