Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

52 рядки
2.7KB

  1. \documentclass{standalone}
  2. \usepackage{tikz,pgfplots}
  3. \usepackage{siltex}
  4. \usetikzlibrary{arrows.meta,positioning,calc,fadings}
  5. \pgfplotsset{compat=1.17}
  6. % Compliant PDF
  7. \usepackage[a-3u]{pdfx}
  8. \begin{document}
  9. \begin{tikzpicture}
  10. \pgfmathsetlengthmacro{\xbarvalue}{-3mm}
  11. \pgfmathsetlengthmacro{\barwidthvalue}{4mm}
  12. \begin{axis}[
  13. xbar=\xbarvalue,
  14. bar width=\barwidthvalue,
  15. xmin=0,
  16. xmax=21,
  17. width=85mm,
  18. height=80mm,
  19. enlarge y limits=0.15,
  20. legend style={at={(0.98,0.95)},
  21. anchor=north east,legend columns=-1},
  22. xlabel={Days},
  23. symbolic y coords={Software Development,Hardware Construction,Development Cycle 2,Development Cycle 1,Test Protocol,Feature Definition,Initial Design,Specifications,Problem Description},
  24. ytick=data,
  25. ]
  26. \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)};
  27. \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)};
  28. \legend{Time Spend,Time Planned};
  29. \pgfmathsetlengthmacro{\baroffset}{\barwidthvalue+\xbarvalue/2}
  30. \pgfmathsetlengthmacro{\smeer}{7mm}
  31. \pgfmathsetlengthmacro{\superscriptoffset}{8.5mm}
  32. \node (d) at ($(axis cs:3,Development Cycle 1)+(\superscriptoffset,1mm)$) {\textsuperscript{2}};
  33. \coordinate (a) at ($(axis cs:3,Development Cycle 1)-(0.1mm,0mm)+(0mm,\baroffset)$);
  34. \coordinate (b) at ($(axis cs:3,Development Cycle 1)-(0.1mm,0mm)-(0mm,\baroffset)$);
  35. \fill[white] (a) rectangle ++(\smeer,-\barwidthvalue-1mm);
  36. \fill[red!40,path fading=east] (b) rectangle ++(\smeer,1mm);
  37. \fill[blue!40,path fading=east] (a) rectangle ++(\smeer,-\barwidthvalue);
  38. \draw[white] ($(a)$) -- +(\smeer,0mm) ++(0mm,-\barwidthvalue) -- +(\smeer,0mm);
  39. \draw[white] ($(b)$) -- +(\smeer,0mm);
  40. \draw[blue,path fading=east] ($(a)$) -- +(\smeer,0mm) ++(0mm,-\barwidthvalue) -- +(\smeer,0mm);
  41. \draw[red,path fading=east] ($(b)$) -- +(\smeer,0mm);
  42. \node (e) at ($(axis cs:3,Feature Definition)+(\superscriptoffset,1mm)$) {\textsuperscript{1}};
  43. \coordinate (c) at ($(axis cs:2.5,Feature Definition)-(0.1mm,0mm)-(0mm,\baroffset)$);
  44. \fill[red!40,path fading=east] (c) rectangle ++(\smeer,1mm);
  45. \draw[white] ($(c)$) -- +(\smeer,0mm);
  46. \draw[red,path fading=east] ($(c)$) -- +(\smeer,0mm);
  47. \draw[blue,path fading=east] ($(c)+(0pt,1mm)$) -- +(\smeer,0mm);% ++(0mm,-\barwidthvalue) -- +(\smeer,0mm);
  48. \end{axis}
  49. \end{tikzpicture}
  50. \end{document}