2

To be clear what I want to achieve I provide an easy example which points out what is not working yet.

This code:

\begin{ganttchart}[hgrid,vgrid]{1}{7}
\gantttitlelist{1,...,7}{1} \\
\ganttbar{}{1}{3.5} \\
\ganttbar{}{4.2}{5} \\
\ganttmilestone{}{6.2}
\end{ganttchart}

leads to this chart:

mwe

As you can see, each element (bar, milestone) has been aligned to a time slot. But I want these elements to start/end at exactly that place which I defined, so e.g. the first bar should end in the middle between two slots, the milestone should be at 6.2 (and not 6.0) and so on.

How can I achieve this?

1 Answer 1

2

The arguments must be integers, fractions are truncated.

A simple way would be to multiply everything by 10 and scale down the gantt chart accordingly.

\documentclass{article}
\usepackage{pgfgantt}
\begin{document}
   \begin{ganttchart}[
       hgrid,
       x unit=0.05cm,
       vgrid={*9{draw=none}, dotted},
       milestone left shift = -3.3,
       milestone right shift = 3.3
       ]{1}{70}
       \gantttitlelist{1,...,7}{10} \\
       \ganttbar{}{1}{35} \\
       \ganttbar{}{42}{50} \\
       \ganttmilestone{}{62}
    \end{ganttchart}
\end{document}} 

Result:

enter image description here

1

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.