I want to highlight the weekend rows on my gantt chart, but I am not sure how I could do this.
Also I would like to draw a vertical line on every milestone I have.
And is it possible to split the chart on multiple a4 pages?
My current document looks like this:
\documentclass[
12pt, % font size
oneside, % one-sided pages
]{article}
\usepackage[
a0paper, % paper format
landscape % orientation
]{geometry}
% Encoding
\usepackage[utf8]{inputenc} % utf8
\usepackage[T1]{fontenc} % 8-bit font encoding
% Language
\usepackage[ngerman]{babel} % languages
% Color
\usepackage{xcolor}
% Gantt Chart
\usepackage{pgfgantt}
%
\def\pgfcalendarweekdayletter#1{
%
\ifcase#1Mo\or Di\or Mi\or Do\or Fr\or \textcolor{red}{Sa}\or \textcolor{red}{So}\fi
%
}
\begin{document}
\selectlanguage{ngerman}
\begin{ganttchart}[
hgrid,
vgrid,
x unit=7mm,
time slot format=little-endian,
today={\the\day.\the\month.\the\year},
progress=today,
group incomplete/.append style={fill=gray},
group left shift=0,
group right shift=0,
group height=.2,
group peaks tip position=0,
group peaks width=0.2,
group peaks height=.2,
%group label node/.append style={left=.6cm},
%group progress label font=\bfseries\small,
]{18.09.2017}{31.01.2018}
\gantttitlecalendar{year, month=name, weekday=letter, day} \\
\ganttmilestone[progress label text={}]{Abgabe Schlussbericht}{22.12.2017} \\
\ganttmilestone[progress label text={}]{Abgabe Poster}{29.01.2018} \\
\ganttgroup{Vorbereitung}{18.09.2017}{30.09.2017} \\
\ganttbar{Projektauftrag verfassen}{20.09.2017}{24.09.2017} \\
\ganttbar{Fragenkatalog erstellen}{22.09.2017}{27.09.2017} \\
\ganttgroup{Wissensaufbau}{20.09.2017}{10.10.2017} \\
\ganttbar{Bücher \& Papers suchen}{20.09.2017}{04.10.2017} \\
\ganttbar{Konzepte erarbeiten}{28.09.2017}{08.10.2017} \\
\ganttgroup{Evaluation des Konzepts}{05.10.2017}{25.10.2017} \\
\ganttgroup{Zwischenpräsentation}{30.10.2017}{24.11.2017} \\
\ganttgroup{Abschlusspräsentation}{18.12.2017}{19.01.2018} \\
\end{ganttchart}
\end{document}
Best Answer
Splitting ganttcharts has to be done manually, as Torbjørn T. already mentioned. Lines for milestones are also not build into
pgfgantt
. Weekends can be marked withThis works for gantt charts starting on Mondays. For other weekdays different patterns have to be used.
But
pgfgantt
can be expanded to do what you want.The code below provides the following new options:
vgrid
, even if the latter comes after this option. No default.none
the weekends are not colored. Default:weekend background=none
.true
milestone lines are drawn. Withfalse
lines are not drawn. This option can be given for a whole chart and for individual milestones. It is possible to change this setting locally for a milestone. A milestone line may be overdrawn by the line for today. Default:milestone line=false
.milestone line style/.style={blue,thick}
.The code below patches
pgfgantt
to get the new code executed at the right time. But this means, the code may not work with older or newer versions ofpgfgantt
(here the current version was used: 2013/06/01 v4.0).The code: