In pgfgantt
, connecting multiple simultaneously-starting bars by start-to-start produces a vertical arrow. Does pgfgantt
support a three-segment arrow, i.e. left, down, right? (finish-to-start seems to go five-segment in other tools, too).
1 Answer
Just scrolling a bit in the manual, doesn't look like it's supported out of the box (unless I missed something). But you can define any type of link yourself with \newganttlinktype
. Example below, more info in section 2.9 Links of the pgfgantt
manual.
\documentclass{article}
\usepackage{pgfgantt}
\newganttlinktype{S-S}{
\ganttsetstartanchor{west}
\ganttsetendanchor{west}
\draw [/pgfgantt/link] (\xLeft,\yUpper) -- ++(-\ganttvalueof{link bulge},0) |- (\xRight, \yLower);
}
\begin{document}
\begin{ganttchart}{1}{12}
\gantttitle{2011}{12} \\
\gantttitlelist{1,...,12}{1} \\
\ganttbar{Task 1}{3}{6} \\
\ganttbar{Task 2}{3}{7} \\
\ganttbar{Task 1b}{5}{6} \\
\ganttbar{Task 2b}{6}{7} \\
\ganttlink[link type=S-S]{elem0}{elem1}
\ganttlink[link type=S-S, link bulge=1cm, link/.append style={red, dashed}]{elem2}{elem3}
\end{ganttchart}
\end{document}
-
Thanks! The manual's huge and I've been back and forth through it all day…haven't sat down and given it a thorough enough read yet, I guess. Jun 5, 2021 at 11:43
-
@JohnMoser Actually, compared to some other manuals (notably, pgf/TikZ and
pgfplots
), the 50 pages of thepgfgantt
manual isn't really all that huge ... (Yes, the PDF is about 100 pages, but the last half is the documented code, so not something most people would need to read, I think.) Jun 5, 2021 at 11:48