Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

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
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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