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.
pgfcalendardatetojuliandoesn'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\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 forcalendarlibrary – percusse May 04 '14 at 21:02\mycount. Otherwise it say that it is not defined. – Hunsu May 04 '14 at 21:09