TransWikia.com

pgfgantt how do you connect start-start at the same time with three segment?

TeX - LaTeX Asked on August 18, 2021

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).

One 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.

enter image description here

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}

Correct answer by Torbjørn T. on August 18, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP