1

I'm trying to find a solution to my problem : How to draw vertical lines using pgfgantt package. So I decided to take a look to the package source code and I found this :

\def\@tempa{none}%
    \edef\@tempb{\ganttvalueof{today}}%
    \ifx\@tempa\@tempb\else%
      \draw [/pgfgantt/today rule]
        (\ganttvalueof{today} * \ganttvalueof{x unit}, \y@upper pt) --
        (\ganttvalueof{today} * \ganttvalueof{x unit}, \y@lower pt);%
      \node at (\ganttvalueof{today} * \ganttvalueof{x unit}, \y@lower pt)
        [anchor=north] {\ganttvalueof{today label}};%
    \fi%

I understood what the code does so I decided to do like that :

\draw [/pgfgantt/today rule]
        (\ganttvalueof{2014-05-19} * \ganttvalueof{x unit}, \y@upper pt) --
        (\ganttvalueof{2014-05-19} * \ganttvalueof{x unit}, \y@lower pt);%
      \node at (\ganttvalueof{2014-05-19} * \ganttvalueof{x unit}, \y@lower pt)
        [anchor=north] {Validation date};%

The problem of solution is that \ganttvalueof take a key name not the key value. How to do get the coordinate of date? Someone could show me how to do to make this code work.

Edit

I changed my code :

\draw [/pgfgantt/today rule]
        (\pgfcalendardatetojulian{2014-05-19}{} * \ganttvalueof{x unit}, \y@upper pt) --
        (\pgfcalendardatetojulian{2014-05-19}{} * \ganttvalueof{x unit}, \y@lower pt);%
      \node at (\pgfcalendardatetojulian{2014-05-19}{} * \ganttvalueof{x unit}, \y@lower pt)
        [anchor=north] {Validation date};%

It's still not working. What's the second argument of \pgfcalendardatetojulian?

MWE

\documentclass{article}
\usepackage[frenchb]{babel}  
\usepackage{pgfgantt}
\usetikzlibrary{shadows}

\begin{document}
\begin{tikzpicture} % optional
   \begin{ganttchart}[x unit=1.8mm, 
                  y unit chart=0.87cm, 
                  time slot format=isodate, 
                  vgrid=*{5}{dotted},
                 ]
                  {2014-04-14}{2014-07-11}
       \gantttitlecalendar{month=name} \\ 

       \ganttbar[progress=100]{title1}{2014-04-14}{2014-04-15} \\

       \ganttbar[progress=100]{title2}{2014-04-15}{2014-04-17}
   \end{ganttchart}
\end{tikzpicture}
\end{document}

What I want to do is to have a command \verticalline[style=style, label=some label]{date} that will draw a vertical line like the vertical line for today but at a specified date.

Hunsu
  • 1,721
  • 1
  • 14
  • 29
  • pgfcalendardatetojulian doesn't expand to the number itself but sets the second argument to that number (better to have a counter). – percusse May 04 '14 at 20:51
  • @percusse I don't understand what's the counter? Show me an example please. – Hunsu May 04 '14 at 20:59
  • When you write \pgfcalendardatetojulian{2014-05-19}{<some LaTeX counter>} it computes the result and sets the <some LaTeX counter> to that result. If you don't provide an argument the computation is not used anywhere. You can check the TikZ manual for calendar library – percusse May 04 '14 at 21:02
  • @percusse In the documentation they say to do like that : \pgfcalendardatetojulian{2007-01-14}{\mycount} sets \mycount to 2454115. How to declare \mycount. Otherwise it say that it is not defined. – Hunsu May 04 '14 at 21:09
  • Can you make a small document with everything in place? Then we can see what is missing and how it can be solved? – percusse May 04 '14 at 21:16
  • @percusse see my updated question. – Hunsu May 05 '14 at 06:47

0 Answers0