Skip to content

Instantly share code, notes, and snippets.

@thblckjkr
Created May 15, 2020 02:00
Show Gist options
  • Save thblckjkr/5fb22739ce0c53f473f5fde2a382688b to your computer and use it in GitHub Desktop.
Save thblckjkr/5fb22739ce0c53f473f5fde2a382688b to your computer and use it in GitHub Desktop.
A gantt chart on a tex document
\usepackage{pgfgantt}
% fix gantt colors
\usepackage{xcolor}
\colorlet{barblue}{blue}
\colorlet{groupblue}{green}
\section{Cronograma de Actividades}
\begin{ganttchart}[
canvas/.append style={fill=none, draw=black!5, line width=.75pt},
hgrid style/.style={draw=black!5, line width=.75pt},
vgrid={*1{draw=black!5, line width=.75pt}},
today=1,
today rule/.style={
draw=black!64,
dash pattern=on 3.5pt off 4.5pt,
line width=1pt
},
today label font=\small\bfseries,
title/.style={draw=none, fill=none},
title label font=\bfseries\footnotesize,
title label node/.append style={below=7pt},
include title in canvas=false,
bar label font=\mdseries\small\color{black!70},
bar label node/.append style={left=2cm},
bar/.append style={draw=none, fill=black!63},
bar incomplete/.append style={fill=barblue},
bar progress label font=\mdseries\footnotesize\color{black!70},
link/.style={-latex, line width=1.5pt, linkred},
link label font=\scriptsize\bfseries,
link label node/.append style={below left=-2pt and 0pt},
expand chart=\textwidth
]{1}{24}
\gantttitle{Cronograma de actividades}{24} \\[grid]
\gantttitle{Abr}{2}
\gantttitle{May}{4}
\gantttitle{Jun}{4}
\gantttitle{Jul}{4}
\gantttitle{Ago}{4}
\gantttitle{Sept}{4}
\gantttitle{Oct}{4}
\gantttitle{Nov}{2}\\
\gantttitle[
title label node/.append style={below left=7pt and -3pt}
]{Semana:\quad1}{1}
\gantttitlelist{2,...,24}{1} \\
\ganttgroup[progress=65]{Título del grupo}{1}{24} \\
\ganttbar[
progress=100,
name=bar1
]{\textbf{Actividad 1}}{1}{1} \\
\ganttbar[
progress=14,
name=bar2
]{\textbf{Actividad 2}}{2}{2} \\
\ganttbar[
progress=25,
name=bar3
]{\textbf{Actividad 3}}{3}{3} \\
\ganttbar[
progress=56,
name=bar4
]{\textbf{Actividad 4}}{4}{4} \\
\ganttbar[
progress=100,
name=bar5
]{\textbf{Actividad 5}}{5}{7} \\
\ganttbar[
progress=80,
]{\textbf{Actividad 6}}{8}{8} \\
\ganttbar[
progress=49,
]{\textbf{Actividad 7}}{9}{11} \\
\ganttmilestone{Hito 1}{11}{11} \\
\ganttmilestone{Hito 2}{12}{12} \\
\ganttbar[
progress=35,
]{\textbf{Actividad 8}}{12}{22} \\
\ganttbar[
progress=0,
]{\textbf{Actividad 9}}{23}{24} \\
\ganttmilestone{Q6 report}{24}{24} \\
\ganttmilestone{M2: Project finished}{24}{24}
% \ganttlink[link type=f-s]{bar1}{bar2}
% \ganttlink[link type=f-s]{bar4}{bar5}
\end{ganttchart}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment