5

I'm using the pgfgantt package to draw Gantt-Charts. Everything works except for one things: I can not change the style of the links. The documentation shows on page 29 the following example:

\begin{ganttchart}[vgrid, hgrid, link/.style={-latex, red}]{12}
\gantttitle{Title}{12} \\
\ganttbar{Task 1}{2}{3} \\
\ganttbar{Task 2}{2}{5} \\
\ganttbar{Task 3}{6}{11} \\
\ganttbar{Task 4}{8}{11}
\ganttlink[link type=s-s]{elem0}{elem1}
\ganttlink[link type=f-s]{elem1}{elem2}
\ganttlink[link type=f-f]{elem2}{elem3}
\end{ganttchart}

According to the documentation, this should lead to:

Should be

If I compile this code, I only get:

Is

I can put whatever style definition I want into the link\.style but nothing works. What am I doing wrong?

4

The syntax is different, according to the manual:

\begin{ganttchart}[vgrid, hgrid, link={-latex,red}]{12}

However, it works with link/.style. Minimal example, I chose even other styles:

\documentclass{article}
\usepackage{pgfgantt}
\begin{document}
\begin{tikzpicture}[x=.5cm, y=1cm]
  \begin{ganttchart}[vgrid, hgrid, link/.style={-stealth, thick,blue}]{12}
    \gantttitle{Title}{12} \\
    \ganttbar{Task 1}{2}{3} \\
    \ganttbar{Task 2}{2}{5} \\
    \ganttbar{Task 3}{6}{11} \\
    \ganttbar{Task 4}{8}{11}
    \ganttlink[link type=s-s]{elem0}{elem1}
    \ganttlink[link type=f-s]{elem1}{elem2}
    \ganttlink[link type=f-f]{elem2}{elem3}
  \end{ganttchart}
\end{tikzpicture}
\end{document}

Gantt chart

If you dont't get this result

  • Check your other code, which you did not show
  • Update your packages, pgf/TikZ and pgfgantt
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.