Problem: I am trying to include more information on the task name on a Gantt chart made with pgfgantt, in the form: ID, task name, duration and perhaps more information such as start/end dates. I am planning on making fortnightly and summary Gantt charts for specific periods so I need to include ID's so that they can be referenced.
My current method: I am using a custom command with \parbox
's so that the information can be included and spaced correctly but I could not see a way to include a heading above it to specify what the information means e.g. "ID", "Task Name", "Duration". Nor could I find a way to include formatting like boundaries so it resembles a table.
What I would like: Preferably, if there is a way to put information in a table to the left of the Gantt chart that would be ideal, but if that is not possible or difficult (I do not know TikZ well and I read that is what pgfgantt uses) then a way of introducing boundaries ("1 | Example task name | 3 days ") and/or a heading above the first entry would be nice. I am open to other methods then using \parbox
but that is a back-up method if needed. I obtained most of the code in the MWE from the pgfgantt manual, I think it was an example.
MWE:
\documentclass{article}
\usepackage{pgfgantt}
\usepackage[landscape]{geometry}
\newcommand\TEF[3]{\textbf{[#1]}\hspace{0.2cm}\parbox{3cm}{#2}\hspace{0.2cm}\parbox{1cm}{#3}}
\begin{document}
\begin{ganttchart}[ %
vgrid, hgrid,
y unit title=0.6cm,
y unit chart=0.5cm,
title label font=\tiny,
bar label font=\tiny,
group label font=\tiny,
milestone label font=\tiny,
today label font=\tiny,
vrule label font=\tiny]{1}{24}
\gantttitle{2011}{24} \\
\gantttitlelist{1,...,24}{1} \\
\ganttgroup{\TEF{3}{Text to see if it puts it in right}{14 days}}{1}{7} \\
\ganttbar{\TEF{3}{Text to see if it puts it in right}{2 days}}{1}{2} \\
\ganttlinkedbar{\TEF{3}{Text to see if it puts it in right}{2 days}}{3}{7} \ganttnewline
\ganttmilestone{\TEF{3}{Text to see if it puts it in right}{2 days}}{7} \ganttnewline
\ganttbar{\TEF{3}{Text to see if it puts it in}{2 days}}{8}{12}
\ganttlink{elem2}{elem3}
\ganttlink{elem3}{elem4}
\end{ganttchart}
\end{document}
How it currently looks:
Any help would be appreciated, I am not sure why there is such a gap between the "# days" and the chart either.
Best Answer
One possibility is to style the
bar-
,group-
andmilestone-
label node
keys usingrectangle split
to make 3 columns. Then you can use a modified version of your\TEF
command to place the content in eachnodepart
. Each of thosenodepart
s can then be formatted for the necessary width, alignment and so on. The column headers are just aganttbar
that does not draw a bar.Which gives this: