0

so I'd like to typeset a Gantt chart like the one pictured below. It shoud go: Year>Month>Day of month, preferably with the orientation in the second image:

enter image description here

What I get:

enter image description here

My code:

\documentclass{article}
\usepackage{pgfgantt}
\usepackage{rotating}
\usepackage[graphicx]{realboxes}

\newganttchartelement*{mymilestone}{
mymilestone/.style={
shape=isosceles triangle,
inner sep=0pt,
draw=cyan,
top color=white,
bottom color=cyan!50
},
mymilestone incomplete/.style={
/pgfgantt/mymilestone,
draw=yellow,
bottom color=yellow!50
},
mymilestone label font=\slshape,
mymilestone left shift=0pt,
mymilestone right shift=0pt
}

\newgantttimeslotformat{stardate}{%
\def\decomposestardate##1.##2\relax{%
\def\stardateyear{##1}\def\stardateday{##2}%
}%
\decomposestardate#1\relax%
\pgfcalendardatetojulian{\stardateyear-01-01}{#2}%
\advance#2 by-1\relax%
\advance#2 by\stardateday\relax%
}


\begin{document}
\begin{sidewaysfigure}
\begin{ganttchart}[vgrid, hgrid]{1}{24}
\gantttitle{2019}{12} 
\gantttitle{2020}{12}\\
\gantttitlelist{1,...,24}{1}\\
%First Group
\ganttgroup{Group 1}{1}{10} \\
\ganttbar{Task 1}{2}{3} \\
\ganttbar{Task 2}{4}{10} \\
\ganttbar{Task 3}{9}{12}\\
%\ganttlink{elem0}{elem1}
\ganttlink{elem1}{elem2}
\ganttlink{elem2}{elem3}
%\ganttmilestone{Milestone 1}{11}
%Second Group
\ganttgroup{Group 2}{14}{20} \\
\ganttbar{Task 1}{15}{18} \\
\ganttbar{Task 2}{18}{21} \\
\ganttbar{Task 3}{22}{24}\\
%\ganttlink{elem4}{elem5}
\ganttlink{elem5}{elem6}
\ganttlink{elem6}{elem7}
%\ganttmilestone{Milestone 1}{11}
\end{ganttchart}
\end{sidewaysfigure}

\end{document}
  • 1
    Do you really want to divide a diagram covering two years into days? – Torbjørn T. Oct 18 '19 at 17:15
  • Hmm, maybe not, I'm mapping a short dissertation project and need to state the days taken as well as months. Would there be a way to add months and weeks and specify days separately? – Roberto_1986 Oct 18 '19 at 17:16
  • 1
    One way of specifying days could be to add a textual label above each bar, as seen in e.g. https://tex.stackexchange.com/questions/403126 That one doesn't calculate the number of days, but there might be a way of doing that, if needed. Regarding weeks, I don't know. – Torbjørn T. Oct 18 '19 at 17:23

0 Answers0