3

I have a problem with my gantt chart. It looks squished because i am specifying timeframes in weeks, but they are shown in days. Therefore, the milestone rectangle looks weird.

I already tried to set time slot unit to week, but unfortunately this key is not available.

What are my options?

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{pgfgantt}

\begin{document}

\section{MWE}

\begin{ganttchart}[
  hgrid,
  vgrid={*{6}{draw=none}, dotted},
  x unit=0.125cm,
  time slot format=isodate,
  time slot unit=day,
  calendar week text = {W\currentweek{}}
  ]{2019-02-04}{2019-05-19}
  \gantttitlecalendar{year, month=name, week} \\
  \ganttgroup{Proposal}{2019-02-04}{2019-02-24} \\
  \ganttbar{Proposal Submits}{2019-02-04}{2019-02-10}
  \ganttlinkedbar{}{2019-02-18}{2019-02-24} \\

  \ganttgroup{Implementation}{2019-02-11}{2019-03-03} \\
  \ganttbar{Something}{2019-02-11}{2019-02-17} \\ 
  \ganttlinkedbar{Else...}{2019-02-18}{2019-03-03} \\
  \ganttlinkedmilestone{Milestone 1}{2019-03-03}
\end{ganttchart}

\end{document}

Gantt Chart


The question PGFGantt Compressed Calendar by week? seems to be related, but I think I actually applied the solution and it is not that useful in my case, because I have a lot more frames causing the problem. On the other side I am not able to increase x unit because then the chart does not longer fit the page.

Jens
  • 153
  • what do you mean by they are shown in days? I see they are being shown in weeks ;) Could you clarify a bit more about what exactly you are trying to achieve? – Raaja_is_at_topanswers.xyz Feb 06 '19 at 10:07
  • 1
    it is shown as weeks because i set vgrid. the underlying time unit is days. Because of that the marker for milestones looks squished. – Jens Feb 06 '19 at 10:12

1 Answers1

6

May be as said in the pgfgantt manual (under the section 2.7.3 Options: Chart Element Positioning), we could play with milestone left shift =<factor>, milestone right shift = <factor> to relax the squished representation.

\documentclass{standalone}
\usepackage{pgfgantt}

\begin{document}


\begin{ganttchart}[
    hgrid,
    vgrid={*{6}{draw=none}, dotted},
    x unit=0.125cm,
    time slot format=isodate,
%   time slot unit=day,
    calendar week text = {W\currentweek{}},
    milestone left shift =-1,
    milestone right shift =2
   %%
    ]{2019-02-04}{2019-05-19}
    \gantttitlecalendar{year, month=name, week} \\
    \ganttgroup{Proposal}{2019-02-04}{2019-02-24} \\
    \ganttbar{Proposal Submits}{2019-02-04}{2019-02-10}
    \ganttlinkedbar{}{2019-02-18}{2019-02-24} \\

    \ganttgroup{Implementation}{2019-02-11}{2019-03-03} \\
    \ganttbar{Something}{2019-02-11}{2019-02-17} \\ 
    \ganttlinkedbar{Else...}{2019-02-18}{2019-03-03} \\
    \ganttlinkedmilestone{Milestone 1}{2019-03-03}
\end{ganttchart}

\end{document}

this gives you:

enter image description here

Update 1 with Jens's nice update

\documentclass{standalone}
\usepackage{pgfgantt}

\begin{document}


    \begin{ganttchart}[
        hgrid,
        vgrid={*{6}{draw=none}, dotted},
        x unit=0.125cm,
        time slot format=isodate,
        %   time slot unit=day,
        calendar week text = {W\currentweek{}},
        milestone left shift =-1,
        milestone right shift =2,
        chart element start border=right,
        % Jens's nice update
        link bulge = 1.3,
        link/.style={-to, rounded corners = 3pt}
        %%
        ]{2019-02-04}{2019-05-19}
        \gantttitlecalendar{year, month=name, week} \\
        \ganttgroup{Proposal}{2019-02-04}{2019-02-24} \\
        \ganttbar{Proposal Submits}{2019-02-04}{2019-02-10}
        \ganttlinkedbar{}{2019-02-18}{2019-02-24} \\

        \ganttgroup{Implementation}{2019-02-11}{2019-03-03} \\
        \ganttbar{Something}{2019-02-11}{2019-02-17} \\ 
        \ganttlinkedbar{Else...}{2019-02-18}{2019-03-03} \\
        \ganttlinkedmilestone{Milestone 1}{2019-03-03}
    \end{ganttchart}

\end{document}

we can get:

enter image description here

PS: I also believe that bar/group left/right shift can yield these smooth links (of course neither the bulge not the rounded corners ;-)).