I have this code that generates the process gantt chart:
\usetikzlibrary{shadows,arrows,positioning}
\begin{tikzpicture}[scale=0.75, transform shape]
\tikzset{every node/.style={minimum height=2em},
proc/.style={draw=black, fill=blue!15, drop shadow},
}
\node [draw, proc, minimum width=3em] (p2) {P2};
\node [draw, proc, minimum width=3em, right=0em of p2.east, anchor=west] (p3) {P3};
\node [draw, proc, minimum width=24em, right=0em of p3.east, anchor=west] (p1) {P1};
\node [below=of p2.west] {0} edge [draw] (p2.west);
\node [below=of p2.east] {3} edge [draw] (p2.east);
\node [below=of p3.east] {6} edge [draw] (p3.east);
\node [below=of p1.east] {30} edge [draw] (p1.east);
\end{tikzpicture}
The output:

I can see a pattern over here and I can imagine passing the parameters (e.g. p2/3,p3/3,p1/24) to some command that uses some kind of for loop to automatically generate the code. Unfortunately, my TikZ/LaTeX skills are way below that. Can anyone help me get started with automating this?

tikz-timing. – Mark S. Everitt Feb 17 '12 at 10:51