diff options
author | Karl Berry <karl@freefriends.org> | 2012-01-27 00:06:51 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-01-27 00:06:51 +0000 |
commit | 65d9090a00624d22b2b6b35a4fbe09ae39f29174 (patch) | |
tree | ea065eb9f83f29b66f76eb8d7fde43b4259c839a /Master/texmf-dist/tex/latex/pgfgantt | |
parent | c6dd4805eb3789701aed68b6ba8f2d05bf4e4a7d (diff) |
pgfgantt 3.0 (26jan12)
git-svn-id: svn://tug.org/texlive/trunk@25204 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/pgfgantt')
-rw-r--r-- | Master/texmf-dist/tex/latex/pgfgantt/pgfgantt.sty | 919 |
1 files changed, 539 insertions, 380 deletions
diff --git a/Master/texmf-dist/tex/latex/pgfgantt/pgfgantt.sty b/Master/texmf-dist/tex/latex/pgfgantt/pgfgantt.sty index 51772768ba7..1eefffd2d48 100644 --- a/Master/texmf-dist/tex/latex/pgfgantt/pgfgantt.sty +++ b/Master/texmf-dist/tex/latex/pgfgantt/pgfgantt.sty @@ -6,7 +6,7 @@ %% %% pgfgantt.dtx (with options: `pgfgantt') %% -%% Copyright (C) 2011 by Wolfgang Skala +%% Copyright (C) 2012 by Wolfgang Skala %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -16,9 +16,10 @@ %% and version 1.3 or later is part of all distributions of LaTeX %% version 2005/12/01 or later. %% -\ProvidesPackage{pgfgantt}[2011/11/10 v2.1 Draw Gantt diagrams with TikZ] +\ProvidesPackage{pgfgantt}[2012/01/25 v3.0 Draw Gantt diagrams with TikZ] \NeedsTeXFormat{LaTeX2e}[1999/12/01] + \RequirePackage{tikz} \usetikzlibrary{arrows,backgrounds,calc,patterns,positioning} @@ -34,243 +35,203 @@ \def\ganttset#1{\pgfqkeys{/pgfgantt}{#1}} -\def\@gtt@keydef#1{% - \pgfkeysdef{/pgfgantt/#1}{% - \expandafter\def\csname gtt@#1\endcsname{##1}% - }% +\def\@gtt@keydef#1#2{% + \pgfkeyssetvalue{/pgfgantt/#1}{#2}% } -\def\@gtt@get#1{\csname gtt@#1\endcsname} -\def\@gtt@stylekeydef#1{% - \pgfkeysdef{/pgfgantt/#1}{% - \pgfkeys{/pgfgantt/#1@style/.style={##1}}% - }% +\def\ganttvalueof#1{% + \pgfkeysvalueof{/pgfgantt/#1}% } -\def\@gtt@linkkeydef#1#2#3#4{% - \pgfkeysdef{/pgfgantt/link type/#1}{% - \def\gtt@link@type{#1}% - \def\gtt@link@startanchor{#3}% - \def\gtt@link@endanchor{#4}% - }% - \ganttset{link label={#1}{#2}}% +\def\@gtt@stylekeydef#1#2{% + \pgfkeys{/pgfgantt/#1/.style={#2}}% } - -\@gtt@stylekeydef{hgrid style} +\@gtt@stylekeydef{hgrid style}{dotted} \newif\ifgtt@hgrid -\pgfkeysdef{/pgfgantt/hgrid}{% - \def\@tempa{#1}% - \def\@tempb{false}% - \ifx\@tempa\@tempb% - \gtt@hgridfalse% - \else% - \gtt@hgridtrue% - \def\@tempb{true}% +\ganttset{% + hgrid/.code={% + \def\@tempa{#1}% + \def\@tempb{false}% \ifx\@tempa\@tempb% - \def\gtt@hgridstyle{dotted}% + \gtt@hgridfalse% \else% - \def\gtt@hgridstyle{#1}% + \gtt@hgridtrue% + \def\@tempb{true}% + \ifx\@tempa\@tempb% + \def\gtt@hgridstyle{dotted}% + \else% + \def\gtt@hgridstyle{#1}% + \fi% \fi% - \fi% + },% + hgrid/.default=dotted } -\pgfkeys{/pgfgantt/hgrid/.default=dotted} \newif\ifgtt@vgrid -\pgfkeysdef{/pgfgantt/vgrid}{% - \def\@tempa{#1}% - \def\@tempb{false}% - \ifx\@tempa\@tempb% - \gtt@vgridfalse% - \else% - \gtt@vgridtrue% - \def\@tempb{true}% +\ganttset{% + vgrid/.code={% + \def\@tempa{#1}% + \def\@tempb{false}% \ifx\@tempa\@tempb% - \def\gtt@vgridstyle{dotted}% + \gtt@vgridfalse% \else% - \def\gtt@vgridstyle{#1}% + \gtt@vgridtrue% + \def\@tempb{true}% + \ifx\@tempa\@tempb% + \def\gtt@vgridstyle{dotted}% + \else% + \def\gtt@vgridstyle{#1}% + \fi% \fi% - \fi% + },% + vgrid/.default=dotted } -\pgfkeys{/pgfgantt/vgrid/.default=dotted} -\@gtt@keydef{x unit} -\@gtt@keydef{y unit title} -\@gtt@keydef{y unit chart} +\@gtt@keydef{x unit}{.5cm} +\@gtt@keydef{y unit title}{1cm} +\@gtt@keydef{y unit chart}{1cm} -\@gtt@stylekeydef{canvas} -\@gtt@keydef{today} -\@gtt@stylekeydef{today rule} -\@gtt@keydef{today label} +\@gtt@stylekeydef{canvas}{fill=white} +\@gtt@keydef{today}{none} +\@gtt@stylekeydef{today rule}{dashed, line width=1pt} +\@gtt@keydef{today label}{TODAY} -\@gtt@stylekeydef{title} -\@gtt@keydef{title label font} -\@gtt@stylekeydef{title label anchor} -\pgfkeysdef{/pgfgantt/title list options}{% - \def\gtt@titlelistoptions{[#1]}% +\@gtt@stylekeydef{title}{fill=white} +\@gtt@keydef{title label font}{\small} +\@gtt@stylekeydef{title label anchor}{anchor=mid} +\ganttset{% + title list options/.code={% + \def\gtt@titlelistoptions{[#1]}% + },% + title list options={var=\x, evaluate=\x}% } -\@gtt@keydef{title left shift} -\@gtt@keydef{title right shift} -\@gtt@keydef{title top shift} -\@gtt@keydef{title height} +\@gtt@keydef{title left shift}{0} +\@gtt@keydef{title right shift}{0} +\@gtt@keydef{title top shift}{0} +\@gtt@keydef{title height}{.6} \newif\ifgtt@includetitle -\pgfkeys{/pgfgantt/include title in canvas/.is if=gtt@includetitle} +\ganttset{% + include title in canvas/.is if=gtt@includetitle,% + include title in canvas +} -\@gtt@keydef{name} -\@gtt@keydef{time slot modifier} +\@gtt@keydef{name}{} +\@gtt@keydef{time slot modifier}{-1} \newif\ifgtt@inline -\pgfkeys{/pgfgantt/inline/.is if=gtt@inline} - -\@gtt@stylekeydef{bar} -\pgfkeysdef{/pgfgantt/bar label text}{% - \def\gtt@barlabeltext##1{#1}% -} -\@gtt@keydef{bar label font} -\@gtt@stylekeydef{bar label anchor} -\@gtt@stylekeydef{bar label inline anchor} -\@gtt@keydef{bar left shift} -\@gtt@keydef{bar right shift} -\@gtt@keydef{bar top shift} -\@gtt@keydef{bar height} - -\@gtt@stylekeydef{group} -\pgfkeysdef{/pgfgantt/group label text}{% - \def\gtt@grouplabeltext##1{#1}% -} -\@gtt@keydef{group label font} -\@gtt@stylekeydef{group label anchor} -\@gtt@stylekeydef{group label inline anchor} -\@gtt@keydef{group left shift} -\@gtt@keydef{group right shift} -\@gtt@keydef{group top shift} -\@gtt@keydef{group height} -\pgfkeysdefnargs{/pgfgantt/group left peak}{3}{% - \def\@tempa{#1}% - \ifx\@tempa\@empty\else\def\gtt@groupleftpeakmidx{#1}\fi% - \def\@tempa{#2}% - \ifx\@tempa\@empty\else\def\gtt@groupleftpeakinnerx{#2}\fi% - \def\@tempa{#3}% - \ifx\@tempa\@empty\else\def\gtt@groupleftpeaky{#3}\fi% -} -\pgfkeysdefnargs{/pgfgantt/group right peak}{3}{% - \def\@tempa{#1}% - \def\@tempb{-}% - \ifx\@tempa\@empty\else% - \ifx\@tempa\@tempb\else\def\gtt@grouprightpeakmidx{#1}\fi% - \fi% - \def\@tempa{#2}% - \ifx\@tempa\@empty\else% - \ifx\@tempa\@tempb\else\def\gtt@grouprightpeakinnerx{#2}\fi% - \fi% - \def\@tempa{#3}% - \ifx\@tempa\@empty\else\def\gtt@grouprightpeaky{#3}\fi% -} -\pgfkeysdefnargs{/pgfgantt/group peaks}{3}{% - \ganttset{group left peak={#1}{#2}{#3}, group right peak={-#1}{-#2}{#3}}% -} - -\@gtt@keydef{progress} -\@gtt@stylekeydef{bar incomplete} -\@gtt@stylekeydef{group incomplete} -\pgfkeysdef{/pgfgantt/incomplete}{% - \ganttset{bar incomplete={#1}, group incomplete={#1}}% -} -\pgfkeysdef{/pgfgantt/progress label text}{% - \def\gtt@progresslabeltext##1{#1}% -} -\@gtt@keydef{progress label font} -\@gtt@stylekeydef{progress label anchor} - -\@gtt@stylekeydef{milestone} -\pgfkeysdef{/pgfgantt/milestone label text}{% - \def\gtt@milestonelabeltext##1{#1}% -} -\@gtt@keydef{milestone label font} -\@gtt@stylekeydef{milestone label anchor} -\@gtt@stylekeydef{milestone label inline anchor} -\@gtt@keydef{milestone width} -\@gtt@keydef{milestone height} -\@gtt@keydef{milestone xshift} -\@gtt@keydef{milestone yshift} - -\@gtt@stylekeydef{link} -\pgfkeysdefnargs{/pgfgantt/link label}{2}{% - \expandafter\def\csname gtt@link@#1@labeltext\endcsname{#2}% -} -\pgfkeys{/pgfgantt/link type/.is choice} -\@gtt@linkkeydef{arrow}{\relax}{}{} -\@gtt@linkkeydef{s-s}{start-to-start}{lower left}{upper left} -\@gtt@linkkeydef{s-f}{start-to-finish}{lower left}{upper right} -\@gtt@linkkeydef{f-s}{finish-to-start}{lower right}{upper left} -\@gtt@linkkeydef{f-f}{finish-to-finish}{lower right}{upper right} - -\@gtt@keydef{link label font} -\@gtt@stylekeydef{link label anchor} -\@gtt@keydef{link mid} -\@gtt@keydef{link bulge} -\@gtt@keydef{link tolerance} - -\ganttset{ - canvas={fill=white}, - x unit=.5cm, - y unit title=1cm, - y unit chart=1cm, - hgrid style=dotted, - today=none, - today rule={dashed, line width=1pt}, - today label=TODAY, - title={fill=white}, - title label font=\small, - title label anchor={anchor=mid}, - title left shift=0, - title right shift=0, - title top shift=0, - title height=.6, - title list options={var=\x, evaluate=\x}, - include title in canvas, - name={}, - time slot modifier=-1, - inline=false, - bar={fill=white}, - bar label text={\strut#1}, - bar label font=\normalsize, - bar label anchor={anchor=east}, - bar label inline anchor={anchor=center}, - bar left shift=0, - bar right shift=0, - bar top shift=.3, - bar height=.4, - group={fill=black}, - group label text={\strut#1}, - group label font=\normalsize\bfseries, - group label anchor={anchor=east}, - group label inline anchor={anchor=south}, - group left shift=-.1, - group right shift=.1, - group top shift=.4, - group height=.2, - group peaks={.2}{.4}{.1}, - progress=none, - incomplete={fill=black!25}, - progress label text={#1\% complete}, - progress label font=\scriptsize, - progress label anchor={anchor=west}, - milestone={fill=black}, - milestone label text={\strut#1}, - milestone label font=\normalsize\itshape, - milestone label anchor={anchor=east}, - milestone label inline anchor={anchor=south}, - milestone width=.8, - milestone height=.4, - milestone xshift=0, - milestone yshift=.5, - link={-latex, rounded corners=1pt}, - link type=arrow, - link label font=\scriptsize\itshape\normalcolor, - link label anchor={anchor=west}, - link mid=.5, - link bulge=.4, - link tolerance=0.6 -} +\ganttset{% + inline/.is if=gtt@inline,% + inline=false% +} + +\@gtt@stylekeydef{bar}{fill=white} +\ganttset{% + bar label text/.code={% + \def\gtt@barlabeltext##1{#1}% + },% + bar label text={\strut#1}% +} +\@gtt@keydef{bar label font}{\normalsize} +\@gtt@stylekeydef{bar label anchor}{anchor=east} +\@gtt@stylekeydef{bar label inline anchor}{anchor=center} +\@gtt@keydef{bar label shape anchor}{center} +\@gtt@keydef{bar left shift}{0} +\@gtt@keydef{bar right shift}{0} +\@gtt@keydef{bar top shift}{.3} +\@gtt@keydef{bar height}{.4} + +\@gtt@stylekeydef{group}{fill=black} +\ganttset{% + group label text/.code={% + \def\gtt@grouplabeltext##1{#1}% + },% + group label text={\strut#1}% +} +\@gtt@keydef{group label font}{\normalsize\bfseries} +\@gtt@stylekeydef{group label anchor}{anchor=east} +\@gtt@stylekeydef{group label inline anchor}{anchor=south} +\@gtt@keydef{group label shape anchor}{center} +\@gtt@keydef{group left shift}{-.1} +\@gtt@keydef{group right shift}{.1} +\@gtt@keydef{group top shift}{.4} +\@gtt@keydef{group height}{.2} +\ganttset{% + group left peak/.code n args={3}{% + \def\@tempa{#1}% + \ifx\@tempa\@empty\else\def\gtt@groupleftpeakmidx{#1}\fi% + \def\@tempa{#2}% + \ifx\@tempa\@empty\else\def\gtt@groupleftpeakinnerx{#2}\fi% + \def\@tempa{#3}% + \ifx\@tempa\@empty\else\def\gtt@groupleftpeaky{#3}\fi% + },% + group right peak/.code n args={3}{% + \def\@tempa{#1}% + \def\@tempb{-}% + \ifx\@tempa\@empty\else% + \ifx\@tempa\@tempb\else\def\gtt@grouprightpeakmidx{#1}\fi% + \fi% + \def\@tempa{#2}% + \ifx\@tempa\@empty\else% + \ifx\@tempa\@tempb\else\def\gtt@grouprightpeakinnerx{#2}\fi% + \fi% + \def\@tempa{#3}% + \ifx\@tempa\@empty\else\def\gtt@grouprightpeaky{#3}\fi% + },% + group peaks/.code n args={3}{% + \ganttset{% + group left peak={#1}{#2}{#3},% + group right peak={-#1}{-#2}{#3}% + }% + },% + group peaks={.2}{.4}{.1} +} + +\ganttset{% + progress/.code={% + \def\gtt@progress{#1}% + },% + progress=none% +} +\@gtt@stylekeydef{bar incomplete}{} +\@gtt@stylekeydef{group incomplete}{} +\ganttset{% + incomplete/.style/.code={% + \ganttset{bar incomplete/.style={#1}, group incomplete/.style={#1}}% + },% + incomplete/.style={fill=black!25} +} +\ganttset{% + progress label text/.code={% + \def\gtt@progresslabeltext##1{#1}% + },% + progress label text={#1\% complete} +} +\@gtt@keydef{progress label font}{\scriptsize} +\@gtt@stylekeydef{progress label anchor}{anchor=west} + +\@gtt@stylekeydef{milestone}{fill=black} +\ganttset{% + milestone label text/.code={% + \def\gtt@milestonelabeltext##1{#1}% + },% + milestone label text={\strut#1}% +} +\@gtt@keydef{milestone label font}{\normalsize\itshape} +\@gtt@stylekeydef{milestone label anchor}{anchor=east} +\@gtt@stylekeydef{milestone label inline anchor}{anchor=south} +\@gtt@keydef{milestone label shape anchor}{center} +\@gtt@keydef{milestone width}{.8} +\@gtt@keydef{milestone height}{.4} +\@gtt@keydef{milestone xshift}{0} +\@gtt@keydef{milestone yshift}{.5} + +\@gtt@stylekeydef{link}{-latex, rounded corners=1pt} +\@gtt@keydef{link type}{auto} +\@gtt@keydef{link mid}{.5} +\@gtt@keydef{link bulge}{.4} +\@gtt@keydef{link tolerance}{.6} +\@gtt@keydef{link label}{} +\@gtt@keydef{link label font}{\scriptsize\itshape\normalcolor} +\@gtt@stylekeydef{link label anchor}{anchor=west} \def\gtt@vgrid@do#1,{% \ifx\relax#1\else% @@ -287,8 +248,9 @@ \def\gtt@vgrid@draw#1#2\relax{% \foreach \i in {1,...,#1} {% - \draw[#2] (\value{gtt@currgrid} * \@gtt@get{x unit}, \y@upper pt) --% - (\value{gtt@currgrid} * \@gtt@get{x unit}, \y@lower pt);% + \draw [#2] + (\value{gtt@currgrid} * \ganttvalueof{x unit}, \y@upper pt) --% + (\value{gtt@currgrid} * \ganttvalueof{x unit}, \y@lower pt);% \stepcounter{gtt@currgrid}% \ifnum\value{gtt@currgrid}>\value{gtt@width}\breakforeach\fi% }% @@ -310,12 +272,13 @@ \def\gtt@hgrid@draw#1#2\relax{% \foreach \i in {1,...,#1} {% \pgfmathsetmacro\y@upper{% - \value{gtt@lasttitleline} * \@gtt@get{y unit title} +% + \value{gtt@lasttitleline} * \ganttvalueof{y unit title} +% (\value{gtt@currgrid} - \value{gtt@lasttitleline})% - * \@gtt@get{y unit chart}% + * \ganttvalueof{y unit chart}% }% - \draw[#2] (0pt, \y@upper pt) -- - (\value{gtt@width} * \@gtt@get{x unit}, \y@upper pt);% + \draw [#2] + (0pt, \y@upper pt) -- + (\value{gtt@width} * \ganttvalueof{x unit}, \y@upper pt);% \addtocounter{gtt@currgrid}{-1}% \ifnum\value{gtt@currgrid}<\value{gtt@currentline}\breakforeach\fi% }% @@ -341,19 +304,19 @@ \def\y@upper{0}% \else% \pgfmathsetmacro\y@upper{% - \value{gtt@lasttitleline} * \@gtt@get{y unit title}% + \value{gtt@lasttitleline} * \ganttvalueof{y unit title}% }% \fi% \pgfmathsetmacro\y@lower{% - \value{gtt@lasttitleline} * \@gtt@get{y unit title}% + \value{gtt@lasttitleline} * \ganttvalueof{y unit title}% + (\value{gtt@currentline} - \value{gtt@lasttitleline} - 1)% - * \@gtt@get{y unit chart}% + * \ganttvalueof{y unit chart}% }% - \draw[/pgfgantt/canvas@style] + \draw [/pgfgantt/canvas] (0pt, \y@upper pt) rectangle - (\value{gtt@width} * \@gtt@get{x unit}, \y@lower pt);% + (\value{gtt@width} * \ganttvalueof{x unit}, \y@lower pt);% \pgfmathsetmacro\y@upper{% - \value{gtt@lasttitleline} * \@gtt@get{y unit title}% + \value{gtt@lasttitleline} * \ganttvalueof{y unit title}% }% \ifgtt@vgrid \addtocounter{gtt@width}{-1}% @@ -376,12 +339,13 @@ }% \fi% \def\@tempa{none}% - \ifx\gtt@today\@tempa\else% - \draw[/pgfgantt/today rule@style] - (\@gtt@get{today} * \@gtt@get{x unit}, \y@upper pt) -- - (\@gtt@get{today} * \@gtt@get{x unit}, \y@lower pt);% - \node at (\@gtt@get{today} * \@gtt@get{x unit}, \y@lower pt) - [anchor=north] {\@gtt@get{today label}};% + \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% \end{scope}% \ifgtt@tikzpicture\else\end{tikzpicture}\fi% @@ -392,16 +356,16 @@ \def\@tempb{grid}% \ifx\@tempa\@empty\else \ifx\@tempa\@tempb% - \def\@tempa{/pgfgantt/hgrid style@style}% + \def\@tempa{/pgfgantt/hgrid style}% \fi% \pgfmathsetmacro\y@upper{% - \value{gtt@lasttitleline} * \@gtt@get{y unit title}% + \value{gtt@lasttitleline} * \ganttvalueof{y unit title}% + (\value{gtt@currentline} - \value{gtt@lasttitleline} - 1)% - * \@gtt@get{y unit chart}% + * \ganttvalueof{y unit chart}% } \expandafter\draw\expandafter[\@tempa] (0pt, \y@upper pt) -- - (\value{gtt@width} * \@gtt@get{x unit}, \y@upper pt);% + (\value{gtt@width} * \ganttvalueof{x unit}, \y@upper pt);% \fi% \addtocounter{gtt@currentline}{-1}% \ifgtt@intitle\addtocounter{gtt@lasttitleline}{-1}\fi% @@ -412,27 +376,27 @@ \begingroup% \ganttset{#1}% \pgfmathsetmacro\x@left{% - (\value{gtt@lasttitleslot} + \@gtt@get{title left shift})% - * \@gtt@get{x unit}% + (\value{gtt@lasttitleslot} + \ganttvalueof{title left shift})% + * \ganttvalueof{x unit}% }% \pgfmathsetmacro\x@right{% - (\value{gtt@lasttitleslot} + #3 + \@gtt@get{title right shift})% - * \@gtt@get{x unit}% + (\value{gtt@lasttitleslot} + #3 + \ganttvalueof{title right shift})% + * \ganttvalueof{x unit}% }% \pgfmathsetmacro\y@upper{% - (\value{gtt@currentline} - \@gtt@get{title top shift})% - * \@gtt@get{y unit title}% + (\value{gtt@currentline} - \ganttvalueof{title top shift})% + * \ganttvalueof{y unit title}% }% \pgfmathsetmacro\y@lower{% - (\value{gtt@currentline} - \@gtt@get{title top shift}% - - \@gtt@get{title height}) * \@gtt@get{y unit title}% + (\value{gtt@currentline} - \ganttvalueof{title top shift}% + - \ganttvalueof{title height}) * \ganttvalueof{y unit title}% }% - \draw[/pgfgantt/title@style] + \draw [/pgfgantt/title] (\x@left pt, \y@upper pt) rectangle (\x@right pt, \y@lower pt);% - \@gtt@get{title label font}% + \ganttvalueof{title label font}% \node at ($(\x@left pt,\y@upper pt)!.5!(\x@right pt,\y@lower pt)$) - [/pgfgantt/title label anchor@style] {#2};% + [/pgfgantt/title label anchor] {#2};% \addtocounter{gtt@lasttitleslot}{#3}% \endgroup% } @@ -448,18 +412,12 @@ \savedanchor\lowerleft{% \pgfpoint{\x@left pt}{\y@lower pt}% }% - \savedanchor\leftcenter{% - \pgfpoint{\x@left pt}{\y@upper pt / 2 + \y@lower pt / 2}% - }% \savedanchor\upperleft{% \pgfpoint{\x@left pt}{\y@upper pt}% }% \savedanchor\lowerright{% \pgfpoint{\x@right pt}{\y@lower pt}% }% - \savedanchor\rightcenter{% - \pgfpoint{\x@right pt}{\y@upper pt / 2 + \y@lower pt / 2}% - }% \savedanchor\upperright{% \pgfpoint{\x@right pt}{\y@upper pt}% }% @@ -467,35 +425,89 @@ \pgfpoint{\x@right pt / 2 + \x@left pt / 2}% {\y@upper pt / 2 + \y@lower pt / 2}% }% + \anchor{on bottom}{% + \lowerleft% + \pgf@xa\pgf@x% + \lowerright% + \pgf@xb\pgf@x% + \advance\pgf@xb-\pgf@xa% + \advance\pgf@xa\@gtt@linkanchorfraction\pgf@xb% + \pgf@x\pgf@xa% + }% + \anchor{on left}{% + \upperleft% + \pgf@ya\pgf@y% + \lowerleft% + \pgf@yb\pgf@y% + \advance\pgf@yb-\pgf@ya% + \advance\pgf@ya\@gtt@linkanchorfraction\pgf@yb% + \pgf@y\pgf@ya% + }% + \anchor{on top}{% + \upperleft% + \pgf@xa\pgf@x% + \upperright% + \pgf@xb\pgf@x% + \advance\pgf@xb-\pgf@xa% + \advance\pgf@xa\@gtt@linkanchorfraction\pgf@xb% + \pgf@x\pgf@xa% + }% + \anchor{on right}{% + \upperright% + \pgf@ya\pgf@y% + \lowerright% + \pgf@yb\pgf@y% + \advance\pgf@yb-\pgf@ya% + \advance\pgf@ya\@gtt@linkanchorfraction\pgf@yb% + \pgf@y\pgf@ya% + }% + \anchor{center}{\centerpoint}% \anchor{lower left}{\lowerleft}% - \anchor{left}{\leftcenter}% + \anchor{left}{% + \upperleft% + \pgf@ya\pgf@y% + \lowerleft% + \pgf@yb\pgf@y% + \advance\pgf@yb-\pgf@ya% + \advance\pgf@ya.5\pgf@yb% + \pgf@y\pgf@ya% + }% \anchor{upper left}{\upperleft}% \anchor{lower right}{\lowerright}% - \anchor{right}{\rightcenter}% + \anchor{right}{% + \upperright% + \pgf@ya\pgf@y% + \lowerright% + \pgf@yb\pgf@y% + \advance\pgf@yb-\pgf@ya% + \advance\pgf@ya.5\pgf@yb% + \pgf@y\pgf@ya% + }% \anchor{upper right}{\upperright}% - \anchor{center}{\centerpoint}% } \newcommand\ganttbar[4][]{% \begingroup% \ganttset{#1}% \pgfmathsetmacro\x@left{% - (#3 + \@gtt@get{time slot modifier} + \@gtt@get{bar left shift})% - * \@gtt@get{x unit}% + (#3 + \ganttvalueof{time slot modifier}% + + \ganttvalueof{bar left shift})% + * \ganttvalueof{x unit}% }% \pgfmathsetmacro\x@right{% - (#4 + \@gtt@get{bar right shift}) * \@gtt@get{x unit}% + (#4 + \ganttvalueof{bar right shift}) * \ganttvalueof{x unit}% }% \pgfmathsetmacro\y@upper{% - \value{gtt@lasttitleline} * \@gtt@get{y unit title} + \value{gtt@lasttitleline} * \ganttvalueof{y unit title} + (\value{gtt@currentline} - \value{gtt@lasttitleline} - - \@gtt@get{bar top shift}) * \@gtt@get{y unit chart}% + - \ganttvalueof{bar top shift}) * \ganttvalueof{y unit chart}% }% \pgfmathsetmacro\y@lower{% - \y@upper - \@gtt@get{bar height} * \@gtt@get{y unit chart}% + \y@upper - \ganttvalueof{bar height} * \ganttvalueof{y unit chart}% }% + \edef\gtt@name{\ganttvalueof{name}}% \ifx\gtt@name\@empty\edef\gtt@name{elem\thegtt@elementid}\fi% - \node[shape=chart element] (\@gtt@get{name}) + \node [shape=chart element] (\gtt@name) at ($(\x@left pt, \y@upper pt)!.5!(\x@right pt, \y@lower pt)$) {}; \def\@tempa{none}% \ifx\gtt@progress\@tempa% @@ -508,9 +520,9 @@ \def\gtt@pl@draw{% \node at ($(\x@right pt, \y@upper pt)!.5! (\x@right pt, \y@lower pt)$) - [/pgfgantt/progress label anchor@style] {% - \@gtt@get{progress label font}{% - \@gtt@get{progresslabeltext}{\@gtt@get{progress}}% + [/pgfgantt/progress label anchor] {% + \ganttvalueof{progress label font}{% + \gtt@progresslabeltext{\gtt@progress}% }% };% }% @@ -520,33 +532,33 @@ \clip (\x@left pt, \y@upper pt) rectangle ($(\x@left pt, \y@lower pt)!\gtt@progress/100! (\x@right pt, \y@lower pt)$);% - \draw[/pgfgantt/bar@style, draw=none] (\x@left pt, \y@upper pt) + \draw [/pgfgantt/bar, draw=none] (\x@left pt, \y@upper pt) rectangle (\x@right pt, \y@lower pt);% \end{scope}% \begin{scope}% \clip ($(\x@left pt, \y@upper pt)!\gtt@progress/100! (\x@right pt, \y@upper pt)$) rectangle (\x@right pt, \y@lower pt);% - \draw[/pgfgantt/bar incomplete@style, draw=none] + \draw [/pgfgantt/bar incomplete, draw=none] (\x@left pt, \y@upper pt) rectangle (\x@right pt, \y@lower pt);% \end{scope}% - \draw[/pgfgantt/bar@style, fill=none] + \draw [/pgfgantt/bar, fill=none] (\x@left pt, \y@upper pt) rectangle (\x@right pt, \y@lower pt);% \gtt@pl@draw% \def\@tempa{#2}% \ifx\@tempa\@empty\else% \ifgtt@inline% - \node at (\@gtt@get{name}.center) - [/pgfgantt/bar label inline anchor@style] - {\@gtt@get{bar label font}{\gtt@barlabeltext{#2}}};% + \node at (\gtt@name.\ganttvalueof{bar label shape anchor}) + [/pgfgantt/bar label inline anchor] + {\ganttvalueof{bar label font}{\gtt@barlabeltext{#2}}};% \else% \node at ($(0pt, \y@upper pt)!.5!(0pt, \y@lower pt)$) - [/pgfgantt/bar label anchor@style] - {\@gtt@get{bar label font}{\gtt@barlabeltext{#2}}};% + [/pgfgantt/bar label anchor] + {\ganttvalueof{bar label font}{\gtt@barlabeltext{#2}}};% \fi% \fi% \xdef\gtt@lastelement{\gtt@currentelement}% - \xdef\gtt@currentelement{\@gtt@get{name}}% + \xdef\gtt@currentelement{\gtt@name}% \stepcounter{gtt@elementid}% \global\gtt@intitlefalse% \endgroup% @@ -556,65 +568,201 @@ \begingroup% \ganttset{#1}% \ganttbar{#2}{#3}{#4}% - \ganttlink{\gtt@lastelement}{\gtt@currentelement} + \ganttlink{\gtt@lastelement}{\gtt@currentelement}% \endgroup% } +\newcommand\newganttlinktype[2]{% + \expandafter\def\csname @gtt@linktype@#1\endcsname{#2}% +} + +\newcommand\newganttlinktypealias[2]{% + \expandafter\def\csname @gtt@linktype@#1\endcsname{% + \@nameuse{@gtt@linktype@#2}% + }% + \expandafter\def\csname @gtt@linktype@#1@label\endcsname{% + \@nameuse{@gtt@linktype@#2@label}% + }% +} + +\newcommand\setganttlinklabel[2]{% + \expandafter\def\csname @gtt@linktype@#1@label\endcsname{#2}% +} + +\newganttlinktype{r}{% + \draw [/pgfgantt/link] + (\xLeft, \yUpper) -- + (\xRight, \yLower) + node [pos=.5, /pgfgantt/link label anchor] {\ganttlinklabel}; +} +\newganttlinktypealias{default}{r} + +\newganttlinktype{rdr}{% + \draw [/pgfgantt/link] + (\xLeft, \yUpper) -- + ($(\xLeft, \yUpper)!\ganttvalueof{link mid}! + (\xRight, \yUpper)$) -- + ($(\xLeft, \yLower)!\ganttvalueof{link mid}! + (\xRight, \yLower)$) -- + (\xRight, \yLower);% +} + +\newganttlinktype{rdldr}{% + \draw [/pgfgantt/link] + (\xLeft, \yUpper) -- + (\xLeft + \ganttvalueof{link bulge} * \ganttvalueof{x unit}, + \yUpper) -- + ($(\xLeft + \ganttvalueof{link bulge} * \ganttvalueof{x unit}, + \yUpper)!% + \ganttvalueof{link mid}!% + (\xLeft + \ganttvalueof{link bulge} * \ganttvalueof{x unit}, + \yLower)$) -- + ($(\xRight - \ganttvalueof{link bulge} * \ganttvalueof{x unit}, + \yUpper)!% + \ganttvalueof{link mid}!% + (\xRight - \ganttvalueof{link bulge} * \ganttvalueof{x unit}, + \yLower)$) -- + (\xRight - \ganttvalueof{link bulge} * \ganttvalueof{x unit}, + \yLower) -- + (\xRight, \yLower);% +} + +\newganttlinktype{dr}{% + \ganttsetstartanchor{on bottom=.6}% + \ganttsetendanchor{on left}% + \draw [/pgfgantt/link] + (\xLeft, \yUpper) -- + (\xLeft, \yLower) + node [pos=.5, /pgfgantt/link label anchor] {\ganttlinklabel} -- + (\xRight, \yLower);% +} + +\newganttlinktype{s-s}{% + \ganttsetstartanchor{on bottom=0}% + \ganttsetendanchor{on top=0}% + \draw [/pgfgantt/link] + (\xLeft, \yUpper) -- + (\xRight, \yLower) + node [pos=.5, /pgfgantt/link label anchor] {\ganttlinklabel}; +} +\setganttlinklabel{s-s}{start-to-start} + +\newganttlinktype{s-f}{% + \ganttsetstartanchor{on bottom=0}% + \ganttsetendanchor{on top=1}% + \draw [/pgfgantt/link] + (\xLeft, \yUpper) -- + (\xRight, \yLower) + node [pos=.5, /pgfgantt/link label anchor] {\ganttlinklabel}; +} +\setganttlinklabel{s-f}{start-to-finish} + +\newganttlinktype{f-s}{% + \ganttsetstartanchor{on bottom=1}% + \ganttsetendanchor{on top=0}% + \draw [/pgfgantt/link] + (\xLeft, \yUpper) -- + (\xRight, \yLower) + node [pos=.5, /pgfgantt/link label anchor] {\ganttlinklabel}; +} +\setganttlinklabel{f-s}{finish-to-start} + +\newganttlinktype{f-f}{% + \ganttsetstartanchor{on bottom=1}% + \ganttsetendanchor{on top=1}% + \draw [/pgfgantt/link] + (\xLeft, \yUpper) -- + (\xRight, \yLower) + node [pos=.5, /pgfgantt/link label anchor] {\ganttlinklabel}; +} +\setganttlinklabel{f-f}{finish-to-finish} + +\newcommand\gtt@drawlink[1]{% + \@ifundefined{@gtt@linktype@#1}{% + \PackageWarning{pgfgantt}{Link type `#1' unknown, using `default'.}% + \def\@gtt@currlinktype{default}% + }{% + \def\@gtt@currlinktype{#1}% + }% + \edef\@gtt@currlabel{\ganttvalueof{link label}}% + \ifx\@gtt@currlabel\@empty% + \def\ganttlinklabel{% + \ganttvalueof{link label font}{% + \csname @gtt@linktype@\@gtt@currlinktype @label\endcsname% + }% + }% + \else% + \def\ganttlinklabel{% + \ganttvalueof{link label font}{% + \@gtt@currlabel% + }% + }% + \fi% + \@nameuse{@gtt@linktype@\@gtt@currlinktype}% +} + +\def\@gtt@linkanchordef#1{% + \ganttset{% + link anchor/#1/.code={% + \def\@gtt@linkanchor{#1}% + \def\@gtt@linkanchorfraction{##1}% + },% + link anchor/#1/.default=.5% + } +} +\@gtt@linkanchordef{on left} +\@gtt@linkanchordef{on right} +\@gtt@linkanchordef{on top} +\@gtt@linkanchordef{on bottom} +\@gtt@linkanchordef{lower left} +\@gtt@linkanchordef{left} +\@gtt@linkanchordef{upper left} +\@gtt@linkanchordef{lower right} +\@gtt@linkanchordef{right} +\@gtt@linkanchordef{upper right} + +\newcommand\@gtt@setstartanchor[1]{% + \pgfqkeys{/pgfgantt/link anchor}{#1}% + \pgfpointanchor{\@gtt@startelement}{\@gtt@linkanchor}% + \edef\xLeft{\the\pgf@x}% + \edef\yUpper{\the\pgf@y}% +} + +\newcommand\@gtt@setendanchor[1]{% + \pgfqkeys{/pgfgantt/link anchor}{#1}% + \pgfpointanchor{\@gtt@endelement}{\@gtt@linkanchor}% + \edef\xRight{\the\pgf@x}% + \edef\yLower{\the\pgf@y}% +} + \newcommand\ganttlink[3][]{% \begingroup% \ganttset{#1}% - \pgfpointanchor{#2}{right} - \edef\x@left{\the\pgf@x} - \edef\y@upper{\the\pgf@y} - \pgfpointanchor{#3}{left} - \edef\x@right{\the\pgf@x} - \edef\y@lower{\the\pgf@y} - \def\@tempa{arrow} - \ifx\@tempa\gtt@link@type% - \pgfmathparse{abs(\y@upper - \y@lower) <= 1} + \def\@gtt@startelement{#2}% + \def\@gtt@endelement{#3}% + \let\ganttsetstartanchor\@gtt@setstartanchor% + \let\ganttsetendanchor\@gtt@setendanchor% + \ganttsetstartanchor{right}% + \ganttsetendanchor{left}% + \def\@tempa{auto}% + \edef\@tempb{\ganttvalueof{link type}}% + \ifx\@tempa\@tempb% + \pgfmathparse{abs(\yUpper - \yLower) <= 1}% \ifcase\pgfmathresult% - \pgfmathparse{% - (\x@right - \x@left) - >= \@gtt@get{link tolerance} * \@gtt@get{x unit}% + \pgfmathparse{ + (\xRight - \xLeft) + >= \ganttvalueof{link tolerance} * \ganttvalueof{x unit} }% \ifcase\pgfmathresult% - \draw[/pgfgantt/link@style] - (#2.right) -- - (\x@left + \@gtt@get{link bulge} * \@gtt@get{x unit}, - \y@upper) -- - ($(\x@left + \@gtt@get{link bulge} * \@gtt@get{x unit}, - \y@upper)!% - \@gtt@get{link mid}!% - (\x@left + \@gtt@get{link bulge} * \@gtt@get{x unit}, - \y@lower)$) -- - ($(\x@right - \@gtt@get{link bulge} * \@gtt@get{x unit}, - \y@upper)!% - \@gtt@get{link mid}!% - (\x@right - \@gtt@get{link bulge} * \@gtt@get{x unit}, - \y@lower)$) -- - (\x@right - \@gtt@get{link bulge} * \@gtt@get{x unit}, - \y@lower) -- - (#3.left);% + \gtt@drawlink{rdldr}% \else% - \draw[/pgfgantt/link@style] - (#2.right) -- - ($(\x@left, \y@upper)!\@gtt@get{link mid}! - (\x@right, \y@upper)$) -- - ($(\x@left, \y@lower)!\@gtt@get{link mid}! - (\x@right, \y@lower)$) -- - (#3.left);% + \gtt@drawlink{rdr}% \fi% - \else - \draw[/pgfgantt/link@style] (#2.right) -- (#3.left); - \fi + \else% + \gtt@drawlink{r}% + \fi% \else% - \draw[/pgfgantt/link@style] - (#2.\gtt@link@startanchor) -- (#3.\gtt@link@endanchor) - node [pos=.5, /pgfgantt/link label anchor@style] {% - \@gtt@get{link label font}{% - \csname gtt@link@\gtt@link@type @labeltext\endcsname% - }% - };% + \gtt@drawlink{\ganttvalueof{link type}}% \fi% \endgroup% } @@ -623,22 +771,24 @@ \begingroup% \ganttset{#1}% \pgfmathsetmacro\x@left{% - (#3 + \@gtt@get{time slot modifier} + \@gtt@get{group left shift})% - * \@gtt@get{x unit}% + (#3 + \ganttvalueof{time slot modifier}% + + \ganttvalueof{group left shift})% + * \ganttvalueof{x unit}% }% \pgfmathsetmacro\x@right{% - (#4 + \@gtt@get{group right shift}) * \@gtt@get{x unit}% + (#4 + \ganttvalueof{group right shift}) * \ganttvalueof{x unit}% }% \pgfmathsetmacro\y@upper{% - \value{gtt@lasttitleline} * \@gtt@get{y unit title} + \value{gtt@lasttitleline} * \ganttvalueof{y unit title} + (\value{gtt@currentline} - \value{gtt@lasttitleline} - - \@gtt@get{group top shift}) * \@gtt@get{y unit chart}% + - \ganttvalueof{group top shift}) * \ganttvalueof{y unit chart}% }% \pgfmathsetmacro\y@lower{% - \y@upper - \@gtt@get{group height} * \@gtt@get{y unit chart}% + \y@upper - \ganttvalueof{group height} * \ganttvalueof{y unit chart}% }% + \edef\gtt@name{\ganttvalueof{name}}% \ifx\gtt@name\@empty\edef\gtt@name{elem\thegtt@elementid}\fi% - \node[shape=chart element] (\@gtt@get{name}) + \node [shape=chart element] (\gtt@name) at ($(\x@left pt, \y@upper pt)!.5!(\x@right pt, \y@lower pt)$) {}; \def\@tempa{none}% \ifx\gtt@progress\@tempa% @@ -651,9 +801,9 @@ \def\gtt@pl@draw{% \node at ($(\x@right pt, \y@upper pt)!.5! (\x@right pt, \y@lower pt)$) - [/pgfgantt/progress label anchor@style] {% - \@gtt@get{progress label font}{% - \@gtt@get{progresslabeltext}{\@gtt@get{progress}}% + [/pgfgantt/progress label anchor] {% + \ganttvalueof{progress label font}{% + \gtt@progresslabeltext{\gtt@progress}% }% };% }% @@ -661,26 +811,27 @@ \fi% \pgfmathsetmacro\@maxpeak{% \gtt@grouprightpeaky > \gtt@groupleftpeaky ?% - \gtt@grouprightpeaky * \@gtt@get{y unit chart} :% - \gtt@groupleftpeaky * \@gtt@get{y unit chart}% + \gtt@grouprightpeaky * \ganttvalueof{y unit chart} :% + \gtt@groupleftpeaky * \ganttvalueof{y unit chart}% }% \begin{scope}% \clip (\x@left pt, \y@upper pt) rectangle ($(\x@left pt, \y@lower pt - \@maxpeak pt)!% \gtt@progress/100!% (\x@right pt, \y@lower pt - \@maxpeak pt)$);% - \path[/pgfgantt/group@style,draw=none] + \path [/pgfgantt/group, draw=none] (\x@left pt, \y@upper pt) -- (\x@right pt, \y@upper pt) -- (\x@right pt, \y@lower pt) -- - (\x@right pt + \gtt@grouprightpeakmidx * \@gtt@get{x unit}, - \y@lower pt - \gtt@grouprightpeaky * \@gtt@get{y unit chart}) -- - (\x@right pt + \gtt@grouprightpeakinnerx * \@gtt@get{x unit}, + (\x@right pt + \gtt@grouprightpeakmidx * \ganttvalueof{x unit}, + \y@lower pt - \gtt@grouprightpeaky + * \ganttvalueof{y unit chart}) -- + (\x@right pt + \gtt@grouprightpeakinnerx * \ganttvalueof{x unit}, \y@lower pt) -- - (\x@left pt + \gtt@groupleftpeakinnerx * \@gtt@get{x unit}, + (\x@left pt + \gtt@groupleftpeakinnerx * \ganttvalueof{x unit}, \y@lower pt) -- - (\x@left pt + \gtt@groupleftpeakmidx * \@gtt@get{x unit}, - \y@lower pt - \gtt@groupleftpeaky * \@gtt@get{y unit chart}) -- + (\x@left pt + \gtt@groupleftpeakmidx * \ganttvalueof{x unit}, + \y@lower pt - \gtt@groupleftpeaky * \ganttvalueof{y unit chart}) -- (\x@left pt, \y@lower pt) -- cycle;% \end{scope}% @@ -689,50 +840,51 @@ \gtt@progress/100!% (\x@right pt, \y@upper pt)$) rectangle (\x@right pt, \y@lower pt - \@maxpeak pt); - \path[/pgfgantt/group incomplete@style] + \path [/pgfgantt/group incomplete] (\x@left pt, \y@upper pt) -- (\x@right pt, \y@upper pt) -- (\x@right pt, \y@lower pt) -- - (\x@right pt + \gtt@grouprightpeakmidx * \@gtt@get{x unit}, - \y@lower pt - \gtt@grouprightpeaky * \@gtt@get{y unit chart}) -- - (\x@right pt + \gtt@grouprightpeakinnerx * \@gtt@get{x unit}, + (\x@right pt + \gtt@grouprightpeakmidx * \ganttvalueof{x unit}, + \y@lower pt - \gtt@grouprightpeaky + * \ganttvalueof{y unit chart}) -- + (\x@right pt + \gtt@grouprightpeakinnerx * \ganttvalueof{x unit}, \y@lower pt) -- - (\x@left pt + \gtt@groupleftpeakinnerx * \@gtt@get{x unit}, + (\x@left pt + \gtt@groupleftpeakinnerx * \ganttvalueof{x unit}, \y@lower pt) -- - (\x@left pt + \gtt@groupleftpeakmidx * \@gtt@get{x unit}, - \y@lower pt - \gtt@groupleftpeaky * \@gtt@get{y unit chart}) -- + (\x@left pt + \gtt@groupleftpeakmidx * \ganttvalueof{x unit}, + \y@lower pt - \gtt@groupleftpeaky * \ganttvalueof{y unit chart}) -- (\x@left pt, \y@lower pt) -- cycle;% \end{scope}% - \path[/pgfgantt/group@style,fill=none] + \path [/pgfgantt/group, fill=none] (\x@left pt, \y@upper pt) -- (\x@right pt, \y@upper pt) -- (\x@right pt, \y@lower pt) -- - (\x@right pt + \gtt@grouprightpeakmidx * \@gtt@get{x unit}, - \y@lower pt - \gtt@grouprightpeaky * \@gtt@get{y unit chart}) -- - (\x@right pt + \gtt@grouprightpeakinnerx * \@gtt@get{x unit}, + (\x@right pt + \gtt@grouprightpeakmidx * \ganttvalueof{x unit}, + \y@lower pt - \gtt@grouprightpeaky * \ganttvalueof{y unit chart}) -- + (\x@right pt + \gtt@grouprightpeakinnerx * \ganttvalueof{x unit}, \y@lower pt) -- - (\x@left pt + \gtt@groupleftpeakinnerx * \@gtt@get{x unit}, + (\x@left pt + \gtt@groupleftpeakinnerx * \ganttvalueof{x unit}, \y@lower pt) -- - (\x@left pt + \gtt@groupleftpeakmidx * \@gtt@get{x unit}, - \y@lower pt - \gtt@groupleftpeaky * \@gtt@get{y unit chart}) -- + (\x@left pt + \gtt@groupleftpeakmidx * \ganttvalueof{x unit}, + \y@lower pt - \gtt@groupleftpeaky * \ganttvalueof{y unit chart}) -- (\x@left pt, \y@lower pt) -- cycle;% \gtt@pl@draw% \def\@tempa{#2}% \ifx\@tempa\@empty\else% \ifgtt@inline% - \node at (\@gtt@get{name}.center) - [/pgfgantt/group label inline anchor@style] - {\@gtt@get{group label font}{\gtt@grouplabeltext{#2}}};% + \node at (\gtt@name.\ganttvalueof{group label shape anchor}) + [/pgfgantt/group label inline anchor] + {\ganttvalueof{group label font}{\gtt@grouplabeltext{#2}}};% \else% \node at ($(0pt, \y@upper pt)!.5!(0pt, \y@lower pt)$) - [/pgfgantt/group label anchor@style] - {\@gtt@get{group label font}{\gtt@grouplabeltext{#2}}};% + [/pgfgantt/group label anchor] + {\ganttvalueof{group label font}{\gtt@grouplabeltext{#2}}};% \fi% \fi% \xdef\gtt@lastelement{\gtt@currentelement}% - \xdef\gtt@currentelement{\@gtt@get{name}}% + \xdef\gtt@currentelement{\gtt@name}% \stepcounter{gtt@elementid}% \global\gtt@intitlefalse% \endgroup% @@ -742,7 +894,7 @@ \begingroup% \ganttset{#1}% \ganttgroup{#2}{#3}{#4}% - \ganttlink{\gtt@lastelement}{\gtt@currentelement} + \ganttlink{\gtt@lastelement}{\gtt@currentelement}% \endgroup% } @@ -750,29 +902,32 @@ \begingroup% \ganttset{#1}% \pgfmathsetmacro\x@mid{% - (#3 + \@gtt@get{milestone xshift}) * \@gtt@get{x unit}% + (#3 + \ganttvalueof{milestone xshift}) * \ganttvalueof{x unit}% }% \pgfmathsetmacro\x@left{% - \x@mid - \@gtt@get{milestone width} / 2 * \@gtt@get{x unit}% + \x@mid - \ganttvalueof{milestone width} / 2 * \ganttvalueof{x unit}% } \pgfmathsetmacro\x@right{% - \x@mid + \@gtt@get{milestone width} / 2 * \@gtt@get{x unit}% + \x@mid + \ganttvalueof{milestone width} / 2 * \ganttvalueof{x unit}% } \pgfmathsetmacro\y@mid{% - \value{gtt@lasttitleline} * \@gtt@get{y unit title}% + \value{gtt@lasttitleline} * \ganttvalueof{y unit title}% + (\value{gtt@currentline} - \value{gtt@lasttitleline}% - - \@gtt@get{milestone yshift}) * \@gtt@get{y unit chart}% + - \ganttvalueof{milestone yshift}) * \ganttvalueof{y unit chart}% }% \pgfmathsetmacro\y@upper{% - \y@mid + \@gtt@get{milestone height} / 2 * \@gtt@get{y unit chart}% + \y@mid + \ganttvalueof{milestone height} / 2 + * \ganttvalueof{y unit chart}% }% \pgfmathsetmacro\y@lower{% - \y@mid - \@gtt@get{milestone height} / 2 * \@gtt@get{y unit chart}% + \y@mid - \ganttvalueof{milestone height} / 2 + * \ganttvalueof{y unit chart}% }% + \edef\gtt@name{\ganttvalueof{name}}% \ifx\gtt@name\@empty\edef\gtt@name{elem\thegtt@elementid}\fi% - \node[shape=chart element] (\@gtt@get{name}) + \node [shape=chart element] (\gtt@name) at ($(\x@left pt, \y@upper pt)!.5!(\x@right pt, \y@lower pt)$) {}; - \path[/pgfgantt/milestone@style] + \path [/pgfgantt/milestone] (\x@left pt, \y@mid pt) -- (\x@mid pt, \y@lower pt) -- (\x@right pt, \y@mid pt) -- @@ -781,17 +936,21 @@ \def\@tempa{#2}% \ifx\@tempa\@empty\else% \ifgtt@inline% - \node at (\@gtt@get{name}.center) - [/pgfgantt/milestone label inline anchor@style] - {\@gtt@get{milestone label font}{\gtt@milestonelabeltext{#2}}};% + \node at (\gtt@name.\ganttvalueof{milestone label shape anchor}) + [/pgfgantt/milestone label inline anchor] + {\ganttvalueof{milestone label font}{% + \gtt@milestonelabeltext{#2}% + }};% \else% \node at (0pt, \y@mid pt) - [/pgfgantt/milestone label anchor@style] - {\@gtt@get{milestone label font}{\gtt@milestonelabeltext{#2}}};% + [/pgfgantt/milestone label anchor] + {\ganttvalueof{milestone label font}{% + \gtt@milestonelabeltext{#2}% + }};% \fi% \fi% \xdef\gtt@lastelement{\gtt@currentelement}% - \xdef\gtt@currentelement{\@gtt@get{name}}% + \xdef\gtt@currentelement{\gtt@name}% \stepcounter{gtt@elementid}% \global\gtt@intitlefalse% \endgroup% @@ -801,7 +960,7 @@ \begingroup% \ganttset{#1}% \ganttmilestone{#2}{#3}% - \ganttlink{\gtt@lastelement}{\gtt@currentelement} + \ganttlink{\gtt@lastelement}{\gtt@currentelement}% \endgroup% } \endinput |