Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

50 wiersze
2.6KB

  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=80mm,
  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,Hardware Construction,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) (2.5,Feature Definition) (0.5,Test Protocol) (3,Development Cycle 1) (14,Development Cycle 2) (2,Hardware Construction) (20,Software Development)};
  25. \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)};
  26. \legend{Time Spend,Time Planned};
  27. \pgfmathsetlengthmacro{\baroffset}{\barwidthvalue+\xbarvalue/2}
  28. \pgfmathsetlengthmacro{\smeer}{7mm}
  29. \pgfmathsetlengthmacro{\superscriptoffset}{8.5mm}
  30. \node (d) at ($(axis cs:3,Development Cycle 1)+(\superscriptoffset,1mm)$) {\textsuperscript{2}};
  31. \coordinate (a) at ($(axis cs:3,Development Cycle 1)-(0.1mm,0mm)+(0mm,\baroffset)$);
  32. \coordinate (b) at ($(axis cs:3,Development Cycle 1)-(0.1mm,0mm)-(0mm,\baroffset)$);
  33. \fill[white] (a) rectangle ++(\smeer,-\barwidthvalue-1mm);
  34. \fill[red!40,path fading=east] (b) rectangle ++(\smeer,1mm);
  35. \fill[blue!40,path fading=east] (a) rectangle ++(\smeer,-\barwidthvalue);
  36. \draw[white] ($(a)$) -- +(\smeer,0mm) ++(0mm,-\barwidthvalue) -- +(\smeer,0mm);
  37. \draw[white] ($(b)$) -- +(\smeer,0mm);
  38. \draw[blue,path fading=east] ($(a)$) -- +(\smeer,0mm) ++(0mm,-\barwidthvalue) -- +(\smeer,0mm);
  39. \draw[red,path fading=east] ($(b)$) -- +(\smeer,0mm);
  40. \node (e) at ($(axis cs:3,Feature Definition)+(\superscriptoffset,1mm)$) {\textsuperscript{1}};
  41. \coordinate (c) at ($(axis cs:2.5,Feature Definition)-(0.1mm,0mm)-(0mm,\baroffset)$);
  42. \fill[red!40,path fading=east] (c) rectangle ++(\smeer,1mm);
  43. \draw[white] ($(c)$) -- +(\smeer,0mm);
  44. \draw[red,path fading=east] ($(c)$) -- +(\smeer,0mm);
  45. \draw[blue,path fading=east] ($(c)+(0pt,1mm)$) -- +(\smeer,0mm);% ++(0mm,-\barwidthvalue) -- +(\smeer,0mm);
  46. \end{axis}
  47. \end{tikzpicture}
  48. \end{document}