diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/datatool/databar.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/datatool/databar.sty | 570 |
1 files changed, 290 insertions, 280 deletions
diff --git a/Master/texmf-dist/tex/latex/datatool/databar.sty b/Master/texmf-dist/tex/latex/datatool/databar.sty index a381960c486..513e39c512e 100644 --- a/Master/texmf-dist/tex/latex/datatool/databar.sty +++ b/Master/texmf-dist/tex/latex/datatool/databar.sty @@ -7,7 +7,7 @@ %% datatool.dtx (with options: `databar.sty,package') %% %% datatool.dtx -%% Copyright 2009 Nicola Talbot +%% Copyright 2012 Nicola Talbot %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -21,7 +21,7 @@ %% %% The Current Maintainer of this work is Nicola Talbot. %% -%% This work consists of the files datatool.dtx and datatool.ins and the derived files datatool.sty, datapie.sty, dataplot.sty, databar.sty, databib.sty, databib.bst, person.sty. +%% This work consists of the files datatool.dtx and datatool.ins and the derived files datatool-base.sty, datatool-fp.sty, datatool-pgfmath.sty, datatool.sty, databib.sty, databar.sty, datapie.sty, dataplot.sty, person.sty, databib.bst. %% %% \CharacterTable %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -38,13 +38,8 @@ %% Right bracket \] Circumflex \^ Underscore \_ %% Grave accent \` Left brace \{ Vertical bar \| %% Right brace \} Tilde \~} -%% load student information from file "students.csv" -%% Iterate through the student database: -%% Define "anon": -%% Do the letter: -%% Undefine "anon": \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{databar}[2009/10/22 v2.01 (NLCT)] +\ProvidesPackage{databar}[2012/07/18 v2.10 (NLCT)] \RequirePackage{xkeyval} \RequirePackage{dataplot} \newif\ifDTLcolorbarchart @@ -167,9 +162,11 @@ \fi } \define@key{databar}{variable}{% -\def\DTLbarvariable{#1}} + \def\DTLbarvariable{#1}% +} \define@key{databar}{variables}{% -\def\dtlbar@variables{#1}} + \def\dtlbar@variables{#1}% +} \define@key{databar}{barwidth}{\setlength{\DTLbarwidth}{#1}} \define@key{databar}{barlabel}{% \def\dtl@barlabel{#1}} @@ -198,286 +195,299 @@ \def\dtlbar@ylabel{#1}} \let\dtlbar@ylabel=\relax \newcommand*{\DTLbarchart}[4][\boolean{true}]{% -{\let\DTLbarvariable=\relax -\let\DTLbarmax=\relax -\let\DTLnegextent=\relax -\disable@keys{databar}{variables,multibarlabels,% -uppermultibarlabels,groupgap}% -\setkeys{databar}{#2}% -\ifx\DTLbarvariable\relax - \PackageError{databar}{\string\DTLbarchart\space missing - variable}{You haven't use the "variable" key}% -\else - \ifx\DTLbarmax\relax - \@sDTLforeach[#1]{#3}{#4}{% - \expandafter\DTLconverttodecimal\expandafter - {\DTLbarvariable}{\dtl@barvar}% - \ifx\DTLbarmax\relax - \let\DTLbarmax=\dtl@barvar +{% + \undef\DTLbarvariable + \undef\DTLbarmax + \undef\DTLnegextent + \disable@keys{databar}{variables,multibarlabels,% + uppermultibarlabels,groupgap}% + \setkeys{databar}{#2}% + \ifundef{\DTLbarvariable}% + {% + \PackageError{databar}% + {\string\DTLbarchart\space missing variable}% + {You haven't use the "variable" key}% + }% + {% + \ifundef{\DTLbarmax}% + {% + \@sDTLforeach[#1]{#3}{#4}{% + \expandafter\DTLconverttodecimal\expandafter + {\DTLbarvariable}{\dtl@barvar}% + \ifundef{\DTLbarmax}% + {% + \let\DTLbarmax=\dtl@barvar + }% + {% + \let\dtl@old=\DTLbarmax + \dtlmax{\DTLbarmax}{\dtl@old}{\dtl@barvar}% + }% + }% + \ifx\dtlbar@yticgap\relax \else - \let\dtl@old=\DTLbarmax - \FPmax{\DTLbarmax}{\dtl@old}{\dtl@barvar}% + \let\dtl@thistick=\dtlbar@yticgap + \whiledo{\DTLisFPopenbetween{\dtl@thistick}{0}{\DTLbarmax}}% + {% + \dtladd{\dtl@thistick}{\dtl@thistick}{\dtlbar@yticgap}% + }% + \let\DTLbarmax=\dtl@thistick \fi }% - \ifx\dtlbar@yticgap\relax - \else - \let\dtl@thistick=\dtlbar@yticgap% - \whiledo{\DTLisFPopenbetween{\dtl@thistick}{0}{\DTLbarmax}}{% - \FPadd{\dtl@thistick}{\dtl@thistick}{\dtlbar@yticgap}% + {}% + \ifundef{\DTLnegextent}% + {% + \def\DTLnegextent{0}% + \@sDTLforeach[#1]{#3}{#4}{% + \expandafter\DTLconverttodecimal\expandafter + {\DTLbarvariable}{\dtl@barvar}% + \let\dtl@old=\DTLnegextent + \DTLmin{\DTLnegextent}{\dtl@old}{\dtl@barvar}% }% - \let\DTLbarmax=\dtl@thistick - \fi - \fi - \ifx\DTLnegextent\relax - \def\DTLnegextent{0}% - \@sDTLforeach[#1]{#3}{#4}{% - \expandafter\DTLconverttodecimal\expandafter - {\DTLbarvariable}{\dtl@barvar}% - \let\dtl@old=\DTLnegextent - \DTLmin{\DTLnegextent}{\dtl@old}{\dtl@barvar}% + \ifx\dtlbar@yticgap\relax + \else + \ifthenelse{\DTLisFPlt{\DTLnegextent}{0}}% + {% + \edef\dtl@thistick{0}% + \whiledo{\DTLisFPclosedbetween{\dtl@thistick}{\DTLnegextent}{0}}{% + \dtlsub{\dtl@thistick}{\dtl@thistick}{\dtlbar@yticgap}% + }% + \let\DTLnegextent=\dtl@thistick + }{}% + \fi }% - \ifx\dtlbar@yticgap\relax - \else - \ifthenelse{\DTLisFPlt{\DTLnegextent}{0}}{% - \edef\dtl@thistick{0}% - \whiledo{\DTLisFPclosedbetween{\dtl@thistick}{\DTLnegextent}{0}}{% - \FPsub{\dtl@thistick}{\dtl@thistick}{\dtlbar@yticgap}% - }% - \let\DTLnegextent=\dtl@thistick - }{}% - \fi - \fi - \@dtl@tmpcount=\DTLbarchartlength - \FPsub{\dtl@extent}{\DTLbarmax}{\DTLnegextent}% - \FPdiv{\dtl@unit}{\number\@dtl@tmpcount}{\dtl@extent}% - \setlength{\dtl@yticlabelwidth}{0pt}% - \ifDTLbarytics - \ifx\dtlbar@yticlist\relax - \ifx\dtlbar@yticgap\relax - \dtl@constructticklist\DTLnegextent\DTLbarmax - \dtl@unit\dtlbar@yticlist - \else - \dtl@constructticklistwithgapz - \DTLnegextent\DTLbarmax\dtlbar@yticlist\dtlbar@yticgap + {}% + \@dtl@tmpcount=\DTLbarchartlength + \dtlsub{\dtl@extent}{\DTLbarmax}{\DTLnegextent}% + \dtldiv{\dtl@unit}{\number\@dtl@tmpcount}{\dtl@extent}% + \setlength{\dtl@yticlabelwidth}{0pt}% + \ifDTLbarytics + \ifx\dtlbar@yticlist\relax + \ifx\dtlbar@yticgap\relax + \dtl@constructticklist\DTLnegextent\DTLbarmax + \dtl@unit\dtlbar@yticlist + \else + \dtl@constructticklistwithgapz + \DTLnegextent\DTLbarmax\dtlbar@yticlist\dtlbar@yticgap + \fi \fi - \fi - \ifx\dtlbar@ylabel\relax - \else - \ifx\dtlbar@yticlabels\relax - \@for\dtl@thislabel:=\dtlbar@yticlist\do{% - \FPround{\dtl@thislabel}{\dtl@thislabel} - {\c@DTLbarroundvar}% - \ifDTLverticalbars - \settowidth{\dtl@tmplength}{% - \DTLbardisplayYticklabel{\dtl@thislabel}}% - \else - \settoheight{\dtl@tmplength}{% - \DTLbardisplayYticklabel{\dtl@thislabel}}% - \edef\@dtl@h{\the\dtl@tmplength}% - \settodepth{\dtl@tmplength}{% - \DTLbardisplayYticklabel{\dtl@thislabel}}% - \addtolength{\dtl@tmplength}{\@dtl@h}% - \addtolength{\dtl@tmplength}{\baselineskip}% - \fi - \ifdim\dtl@tmplength>\dtl@yticlabelwidth - \setlength{\dtl@yticlabelwidth}{\dtl@tmplength}% - \fi - }% + \ifx\dtlbar@ylabel\relax \else - \@for\dtl@thislabel:=\dtlbar@yticlabels\do{% - \ifDTLverticalbars - \settowidth{\dtl@tmplength}{% - \DTLbardisplayYticklabel{\dtl@thislabel}}% - \else - \settoheight{\dtl@tmplength}{% - \DTLbardisplayYticklabel{\dtl@thislabel}}% - \edef\@dtl@h{\the\dtl@tmplength}% - \settodepth{\dtl@tmplength}{% - \DTLbardisplayYticklabel{\dtl@thislabel}}% - \addtolength{\dtl@tmplength}{\@dtl@h}% - \addtolength{\dtl@tmplength}{\baselineskip}% - \fi - \ifdim\dtl@tmplength>\dtl@yticlabelwidth - \setlength{\dtl@yticlabelwidth}{\dtl@tmplength}% - \fi - }% + \ifx\dtlbar@yticlabels\relax + \@for\dtl@thislabel:=\dtlbar@yticlist\do{% + \dtlround{\dtl@thislabel}{\dtl@thislabel} + {\c@DTLbarroundvar}% + \ifDTLverticalbars + \settowidth{\dtl@tmplength}{% + \DTLbardisplayYticklabel{\dtl@thislabel}}% + \else + \settoheight{\dtl@tmplength}{% + \DTLbardisplayYticklabel{\dtl@thislabel}}% + \edef\@dtl@h{\the\dtl@tmplength}% + \settodepth{\dtl@tmplength}{% + \DTLbardisplayYticklabel{\dtl@thislabel}}% + \addtolength{\dtl@tmplength}{\@dtl@h}% + \addtolength{\dtl@tmplength}{\baselineskip}% + \fi + \ifdim\dtl@tmplength>\dtl@yticlabelwidth + \setlength{\dtl@yticlabelwidth}{\dtl@tmplength}% + \fi + }% + \else + \@for\dtl@thislabel:=\dtlbar@yticlabels\do{% + \ifDTLverticalbars + \settowidth{\dtl@tmplength}{% + \DTLbardisplayYticklabel{\dtl@thislabel}}% + \else + \settoheight{\dtl@tmplength}{% + \DTLbardisplayYticklabel{\dtl@thislabel}}% + \edef\@dtl@h{\the\dtl@tmplength}% + \settodepth{\dtl@tmplength}{% + \DTLbardisplayYticklabel{\dtl@thislabel}}% + \addtolength{\dtl@tmplength}{\@dtl@h}% + \addtolength{\dtl@tmplength}{\baselineskip}% + \fi + \ifdim\dtl@tmplength>\dtl@yticlabelwidth + \setlength{\dtl@yticlabelwidth}{\dtl@tmplength}% + \fi + }% + \fi \fi \fi + \edef\DTLbarchartwidth{\expandafter\number\csname dtlrows@#3\endcsname} + \begin{tikzpicture} + \ifDTLverticalbars + \pgfsetyvec{\pgfpoint{0pt}{\dtl@unit sp}}% + \pgfsetxvec{\pgfpoint{\DTLbarwidth}{0pt}}% + \else + \pgfsetxvec{\pgfpoint{\dtl@unit sp}{0pt}}% + \pgfsetyvec{\pgfpoint{0pt}{\DTLbarwidth}}% + \fi + \DTLbaratbegintikz + \def\@dtl@start{0}% + \@sDTLforeach[#1]{#3}{#4}{% + \expandafter\let\expandafter\@dtl@bar + \csname c@DTLrow\romannumeral\dtlforeachlevel\endcsname% + \expandafter\DTLconverttodecimal\expandafter + {\DTLbarvariable}{\dtl@variable}% + \begin{scope} + \DTLdocurrentbarcolor + \ifDTLverticalbars + \fill (\@dtl@start,0) -- (\@dtl@start,\dtl@variable) + -- (\@dtl@bar,\dtl@variable) -- (\@dtl@bar,0) -- cycle; + \else + \fill (0,\@dtl@start) -- (\dtl@variable,\@dtl@start) + -- (\dtl@variable,\@dtl@bar) -- (0,\@dtl@bar) -- cycle; \fi -\edef\DTLbarchartwidth{\expandafter\number\csname dtlrows@#3\endcsname} -\begin{tikzpicture} -\ifDTLverticalbars - \pgfsetyvec{\pgfpoint{0pt}{\dtl@unit sp}}% - \pgfsetxvec{\pgfpoint{\DTLbarwidth}{0pt}}% -\else - \pgfsetxvec{\pgfpoint{\dtl@unit sp}{0pt}}% - \pgfsetyvec{\pgfpoint{0pt}{\DTLbarwidth}}% -\fi -\DTLbaratbegintikz -\def\@dtl@start{0}% -\@sDTLforeach[#1]{#3}{#4}{% -\expandafter\let\expandafter\@dtl@bar - \csname c@DTLrow\romannumeral\dtlforeachlevel\endcsname% -\expandafter\DTLconverttodecimal\expandafter - {\DTLbarvariable}{\dtl@variable}% -\begin{scope} - \DTLdocurrentbarcolor - \ifDTLverticalbars - \fill (\@dtl@start,0) -- (\@dtl@start,\dtl@variable) - -- (\@dtl@bar,\dtl@variable) -- (\@dtl@bar,0) -- cycle; - \else - \fill (0,\@dtl@start) -- (\dtl@variable,\@dtl@start) - -- (\dtl@variable,\@dtl@bar) -- (0,\@dtl@bar) -- cycle; - \fi -\end{scope} -\begin{scope} -\ifdim\DTLbaroutlinewidth>0pt - \expandafter\color\expandafter{\DTLbaroutlinecolor} - \ifDTLverticalbars - \draw (\@dtl@start,0) -- (\@dtl@start,\dtl@variable) - -- (\@dtl@bar,\dtl@variable) -- (\@dtl@bar,0) -- cycle; - \else - \draw (0,\@dtl@start) -- (\dtl@variable,\@dtl@start) - -- (\dtl@variable,\@dtl@bar) -- (0,\@dtl@bar) -- cycle; - \fi -\fi -\end{scope} -\ifDTLverticalbars - \edef\dtl@textopt{% - at={\noexpand\pgfpointadd - {\noexpand\pgfpointxy{\@dtl@start.5}{0}} - {\noexpand\pgfpoint{0pt}{-\noexpand\DTLbarlabeloffset}}}, - \DTLbarXlabelalign - }% - \edef\DTLstartpt{\noexpand\pgfpointxy{\@dtl@start.5}{0}}% -\else - \edef\dtl@textopt{% - at={\noexpand\pgfpointadd - {\noexpand\pgfpointxy{0}{\@dtl@start.5}} - {\noexpand\pgfpoint{-\noexpand\DTLbarlabeloffset}{0pt}}}, - \DTLbarXlabelalign - }% - \edef\DTLstartpt{\noexpand\pgfpointxy{0}{\@dtl@start.5}}% -\fi - \expandafter\pgftext\expandafter[\dtl@textopt]{% - \DTLdisplaylowerbarlabel{\dtl@barlabel}} -\ifDTLverticalbars - \expandafter\DTLifnumlt\expandafter{\DTLbarvariable}{0} - { + \end{scope} + \begin{scope} + \ifdim\DTLbaroutlinewidth>0pt + \expandafter\color\expandafter{\DTLbaroutlinecolor} + \ifDTLverticalbars + \draw (\@dtl@start,0) -- (\@dtl@start,\dtl@variable) + -- (\@dtl@bar,\dtl@variable) -- (\@dtl@bar,0) -- cycle; + \else + \draw (0,\@dtl@start) -- (\dtl@variable,\@dtl@start) + -- (\dtl@variable,\@dtl@bar) -- (0,\@dtl@bar) -- cycle; + \fi + \fi + \end{scope} + \ifDTLverticalbars \edef\dtl@textopt{% - at={\noexpand\pgfpointadd - {\noexpand\pgfpointxy{\@dtl@start.5}{\dtl@variable}} - {\noexpand\pgfpoint{0pt}{-\noexpand\DTLbarlabeloffset}}} + at={\noexpand\pgfpointadd + {\noexpand\pgfpointxy{\@dtl@start.5}{0}} + {\noexpand\pgfpoint{0pt}{-\noexpand\DTLbarlabeloffset}}}, + \DTLbarXlabelalign }% - }{% + \edef\DTLstartpt{\noexpand\pgfpointxy{\@dtl@start.5}{0}}% + \else \edef\dtl@textopt{% - at={\noexpand\pgfpointadd - {\noexpand\pgfpointxy{\@dtl@start.5}{\dtl@variable}} - {\noexpand\pgfpoint{0pt}{\noexpand\DTLbarlabeloffset}}} - }% - } - \edef\DTLendpt{\noexpand\pgfpointxy{\@dtl@start.5}{\dtl@variable}}% -\else - \expandafter\DTLifnumlt\expandafter{\DTLbarvariable}{0} - { - \edef\dtl@textopt{right, - at={\noexpand\pgfpointadd - {\noexpand\pgfpointxy{\dtl@variable}{\@dtl@start.5}} - {\noexpand\pgfpoint{-\noexpand\DTLbarlabeloffset}{0pt}}} - }% - }{% - \edef\dtl@textopt{left, - at={\noexpand\pgfpointadd - {\noexpand\pgfpointxy{\dtl@variable}{\@dtl@start.5}} - {\noexpand\pgfpoint{\noexpand\DTLbarlabeloffset}{0pt}}} + at={\noexpand\pgfpointadd + {\noexpand\pgfpointxy{0}{\@dtl@start.5}} + {\noexpand\pgfpoint{-\noexpand\DTLbarlabeloffset}{0pt}}}, + \DTLbarXlabelalign }% - } - \edef\DTLendpt{\noexpand\pgfpointxy{\dtl@variable}{\@dtl@start.5}}% -\fi - \expandafter\pgftext\expandafter[\dtl@textopt]{% - \DTLdisplayupperbarlabel{\dtl@upperbarlabel}} -\def\DTLmidpt{\pgfpointlineattime{0.5}{\DTLstartpt}{\DTLendpt}}% - \DTLeverybarhook - \edef\@dtl@start{\number\@dtl@bar}% -} -\ifDTLbarxaxis - \ifDTLverticalbars - \expandafter\draw\expandafter[\DTLBarXAxisStyle] - (0,0) -- (\DTLbarchartwidth,0); - \else - \expandafter\draw\expandafter[\DTLBarXAxisStyle] - (0,0) -- (0,\DTLbarchartwidth); + \edef\DTLstartpt{\noexpand\pgfpointxy{0}{\@dtl@start.5}}% \fi -\fi -\ifDTLbaryaxis + \expandafter\pgftext\expandafter[\dtl@textopt]{% + \DTLdisplaylowerbarlabel{\dtl@barlabel}} \ifDTLverticalbars - \expandafter\draw\expandafter[\DTLBarYAxisStyle] - (0,\DTLnegextent) -- (0,\DTLbarmax); + \expandafter\DTLifnumlt\expandafter{\DTLbarvariable}{0}% + { + \edef\dtl@textopt{% + at={\noexpand\pgfpointadd + {\noexpand\pgfpointxy{\@dtl@start.5}{\dtl@variable}} + {\noexpand\pgfpoint{0pt}{-\noexpand\DTLbarlabeloffset}}} + }% + }{% + \edef\dtl@textopt{% + at={\noexpand\pgfpointadd + {\noexpand\pgfpointxy{\@dtl@start.5}{\dtl@variable}} + {\noexpand\pgfpoint{0pt}{\noexpand\DTLbarlabeloffset}}} + }% + } + \edef\DTLendpt{\noexpand\pgfpointxy{\@dtl@start.5}{\dtl@variable}}% \else - \expandafter\draw\expandafter[\DTLBarYAxisStyle] - (\DTLnegextent,0) -- (\DTLbarmax,0); + \expandafter\DTLifnumlt\expandafter{\DTLbarvariable}{0}% + { + \edef\dtl@textopt{right, + at={\noexpand\pgfpointadd + {\noexpand\pgfpointxy{\dtl@variable}{\@dtl@start.5}} + {\noexpand\pgfpoint{-\noexpand\DTLbarlabeloffset}{0pt}}} + }% + }{% + \edef\dtl@textopt{left, + at={\noexpand\pgfpointadd + {\noexpand\pgfpointxy{\dtl@variable}{\@dtl@start.5}} + {\noexpand\pgfpoint{\noexpand\DTLbarlabeloffset}{0pt}}} + }% + } + \edef\DTLendpt{\noexpand\pgfpointxy{\dtl@variable}{\@dtl@start.5}}% \fi -\fi -\ifx\dtlbar@yticlist\relax -\else - \@for\dtl@thistick:=\dtlbar@yticlist\do{% + \expandafter\pgftext\expandafter[\dtl@textopt]{% + \DTLdisplayupperbarlabel{\dtl@upperbarlabel}} + \def\DTLmidpt{\pgfpointlineattime{0.5}{\DTLstartpt}{\DTLendpt}}% + \DTLeverybarhook + \edef\@dtl@start{\number\@dtl@bar}% + }% + \ifDTLbarxaxis \ifDTLverticalbars - \pgfpathmoveto{\pgfpointxy{0}{\dtl@thistick}} - \pgfpathlineto{ - \pgfpointadd{\pgfpointxy{0}{\dtl@thistick}} - {\pgfpoint{-\DTLticklength}{0pt}}} + \expandafter\draw\expandafter[\DTLBarXAxisStyle] + (0,0) -- (\DTLbarchartwidth,0); \else - \pgfpathmoveto{\pgfpointxy{\dtl@thistick}{0}} - \pgfpathlineto{ - \pgfpointadd{\pgfpointxy{\dtl@thistick}{0}} - {\pgfpoint{0pt}{-\DTLticklength}}} + \expandafter\draw\expandafter[\DTLBarXAxisStyle] + (0,0) -- (0,\DTLbarchartwidth); \fi - \pgfusepath{stroke} - \ifx\dtlbar@yticlabels\relax - \FPround{\dtl@thislabel}{\dtl@thistick} - {\c@DTLbarroundvar}% + \fi + \ifDTLbaryaxis + \ifDTLverticalbars + \expandafter\draw\expandafter[\DTLBarYAxisStyle] + (0,\DTLnegextent) -- (0,\DTLbarmax); \else - \dtl@chopfirst\dtlbar@yticlabels\dtl@thislabel\dtl@rest - \let\dtlbar@yticlabels=\dtl@rest + \expandafter\draw\expandafter[\DTLBarYAxisStyle] + (\DTLnegextent,0) -- (\DTLbarmax,0); \fi + \fi + \ifx\dtlbar@yticlist\relax + \else + \@for\dtl@thistick:=\dtlbar@yticlist\do{% + \ifDTLverticalbars + \pgfpathmoveto{\pgfpointxy{0}{\dtl@thistick}} + \pgfpathlineto{ + \pgfpointadd{\pgfpointxy{0}{\dtl@thistick}} + {\pgfpoint{-\DTLticklength}{0pt}}} + \else + \pgfpathmoveto{\pgfpointxy{\dtl@thistick}{0}} + \pgfpathlineto{ + \pgfpointadd{\pgfpointxy{\dtl@thistick}{0}} + {\pgfpoint{0pt}{-\DTLticklength}}} + \fi + \pgfusepath{stroke} + \ifx\dtlbar@yticlabels\relax + \dtlround{\dtl@thislabel}{\dtl@thistick} + {\c@DTLbarroundvar}% + \else + \dtl@chopfirst\dtlbar@yticlabels\dtl@thislabel\dtl@rest + \let\dtlbar@yticlabels=\dtl@rest + \fi + \ifDTLverticalbars + \edef\dtl@textopt{\DTLbarYticklabelalign,% + at={\noexpand\pgfpointadd + {\noexpand\pgfpointxy{0}{\dtl@thistick}} + {\noexpand\pgfpoint{-\noexpand\DTLticklabeloffset}{0pt}}, + }}% + \else + \edef\dtl@textopt{\DTLbarYticklabelalign, + at={\noexpand\pgfpointadd + {\noexpand\pgfpointxy{\dtl@thistick}{0}} + {\noexpand\pgfpoint{0pt}{-\noexpand\DTLticklabeloffset}} + }}% + \fi + \expandafter\pgftext\expandafter[\dtl@textopt]{% + \DTLbardisplayYticklabel{\dtl@thislabel}} + }% + \fi + \ifx\dtlbar@ylabel\relax + \else + \addtolength{\dtl@yticlabelwidth}{\baselineskip}% + \setlength{\dtl@tmplength}{0.5\DTLbarchartlength} \ifDTLverticalbars - \edef\dtl@textopt{\DTLbarYticklabelalign,% - at={\noexpand\pgfpointadd - {\noexpand\pgfpointxy{0}{\dtl@thistick}} - {\noexpand\pgfpoint{-\noexpand\DTLticklabeloffset}{0pt}}, - }}% + \pgftext[bottom,center,at={\pgfpointadd + {\pgfpointxy{0}{\DTLnegextent}}% + {\pgfpoint{-\dtl@yticlabelwidth}{\dtl@tmplength}}}, + rotate=90]{% + \dtlbar@ylabel} \else - \edef\dtl@textopt{\DTLbarYticklabelalign, - at={\noexpand\pgfpointadd - {\noexpand\pgfpointxy{\dtl@thistick}{0}} - {\noexpand\pgfpoint{0pt}{-\noexpand\DTLticklabeloffset}} - }}% + \pgftext[bottom,center,at={\pgfpointadd + {\pgfpointxy{\DTLnegextent}{0}}% + {\pgfpoint{\dtl@tmplength}{-\dtl@yticlabelwidth}}}]{% + \dtlbar@ylabel} \fi - \expandafter\pgftext\expandafter[\dtl@textopt]{% - \DTLbardisplayYticklabel{\dtl@thislabel}} - }% -\fi -\ifx\dtlbar@ylabel\relax -\else - \addtolength{\dtl@yticlabelwidth}{\baselineskip}% - \setlength{\dtl@tmplength}{0.5\DTLbarchartlength} - \ifDTLverticalbars - \pgftext[bottom,center,at={\pgfpointadd - {\pgfpointxy{0}{\DTLnegextent}}% - {\pgfpoint{-\dtl@yticlabelwidth}{\dtl@tmplength}}}, - rotate=90]{% - \dtlbar@ylabel} - \else - \pgftext[bottom,center,at={\pgfpointadd - {\pgfpointxy{\DTLnegextent}{0}}% - {\pgfpoint{\dtl@tmplength}{-\dtl@yticlabelwidth}}}]{% - \dtlbar@ylabel} \fi -\fi -\DTLbaratendtikz -\end{tikzpicture} -\fi -}} + \DTLbaratendtikz + \end{tikzpicture} + }% +}% +} \newcommand*{\DTLmultibarchart}[4][\boolean{true}]{% {\let\dtlbar@variables=\relax \let\DTLbarmax=\relax @@ -496,7 +506,7 @@ uppermultibarlabels,groupgap}% \let\DTLbarmax=\dtl@barvar \else \let\dtl@old=\DTLbarmax - \FPmax{\DTLbarmax}{\dtl@old}{\dtl@barvar}% + \dtlmax{\DTLbarmax}{\dtl@old}{\dtl@barvar}% \fi }% }% @@ -504,7 +514,7 @@ uppermultibarlabels,groupgap}% \else \let\dtl@thistick=\dtlbar@yticgap% \whiledo{\DTLisFPopenbetween{\dtl@thistick}{0}{\DTLbarmax}}{% - \FPadd{\dtl@thistick}{\dtl@thistick}{\dtlbar@yticgap}% + \dtladd{\dtl@thistick}{\dtl@thistick}{\dtlbar@yticgap}% }% \let\DTLbarmax=\dtl@thistick \fi @@ -524,15 +534,15 @@ uppermultibarlabels,groupgap}% \ifthenelse{\DTLisFPlt{\DTLnegextent}{0}}{% \edef\dtl@thistick{0}% \whiledo{\DTLisFPclosedbetween{\dtl@thistick}{\DTLnegextent}{0}}{% - \FPsub{\dtl@thistick}{\dtl@thistick}{\dtlbar@yticgap}% + \dtlsub{\dtl@thistick}{\dtl@thistick}{\dtlbar@yticgap}% }% \let\DTLnegextent=\dtl@thistick }{}% \fi \fi \@dtl@tmpcount=\DTLbarchartlength - \FPsub{\dtl@extent}{\DTLbarmax}{\DTLnegextent}% - \FPdiv{\dtl@unit}{\number\@dtl@tmpcount}{\dtl@extent}% + \dtlsub{\dtl@extent}{\DTLbarmax}{\DTLnegextent}% + \dtldiv{\dtl@unit}{\number\@dtl@tmpcount}{\dtl@extent}% \setlength{\dtl@yticlabelwidth}{0pt}% \ifDTLbarytics \ifx\dtlbar@yticlist\relax @@ -548,7 +558,7 @@ uppermultibarlabels,groupgap}% \else \ifx\dtlbar@yticlabels\relax \@for\dtl@thislabel:=\dtlbar@yticlist\do{% - \FPround{\dtl@thislabel}{\dtl@thislabel} + \dtlround{\dtl@thislabel}{\dtl@thislabel} {\c@DTLbarroundvar}% \ifDTLverticalbars \settowidth{\dtl@tmplength}{% @@ -608,10 +618,10 @@ uppermultibarlabels,groupgap}% }% \edef\DTLbargroupwidth{\number\@dtl@tmpcount}% \edef\dtl@n{\expandafter\number\csname dtlrows@#3\endcsname} -\FPmul{\dtl@tmpi}{\dtl@n}{\DTLbargroupwidth} -\FPsub{\dtl@tmpii}{\dtl@n}{1}% -\FPmul{\dtl@tmpii}{\dtl@tmpii}{\dtlbar@groupgap}% -\FPadd{\DTLbarchartwidth}{\dtl@tmpi}{\dtl@tmpii} +\dtlmul{\dtl@tmpi}{\dtl@n}{\DTLbargroupwidth} +\dtlsub{\dtl@tmpii}{\dtl@n}{1}% +\dtlmul{\dtl@tmpii}{\dtl@tmpii}{\dtlbar@groupgap}% +\dtladd{\DTLbarchartwidth}{\dtl@tmpi}{\dtl@tmpii} \begin{tikzpicture} \ifDTLverticalbars \pgfsetyvec{\pgfpoint{0pt}{\dtl@unit sp}}% @@ -626,10 +636,10 @@ uppermultibarlabels,groupgap}% \@dtl@barcount = 1\relax \let\dtl@multibar@labels=\dtl@multibarlabels \let\dtl@uppermultibar@labels=\dtl@uppermultibarlabels -\FPmul{\dtl@multimidpt}{\DTLbargroupwidth}{0.5}% -\FPadd{\dtl@multimidpt}{\dtl@multimidpt}{\@dtl@start}% +\dtlmul{\dtl@multimidpt}{\DTLbargroupwidth}{0.5}% +\dtladd{\dtl@multimidpt}{\dtl@multimidpt}{\@dtl@start}% \@for\DTLbarvariable:=\dtlbar@variables\do{% -\FPadd{\@dtl@endpt}{\@dtl@start}{1}% +\dtladd{\@dtl@endpt}{\@dtl@start}{1}% \expandafter\DTLconverttodecimal\expandafter {\DTLbarvariable}{\dtl@variable}% \dtl@chopfirst\dtl@multibar@labels\dtl@thisbarlabel\dtl@rest @@ -658,7 +668,7 @@ uppermultibarlabels,groupgap}% \fi \fi \end{scope} -\FPadd{\@dtl@midpt}{\@dtl@start}{0.5}% +\dtladd{\@dtl@midpt}{\@dtl@start}{0.5}% \ifDTLverticalbars \edef\dtl@textopt{% at={\noexpand\pgfpointadd @@ -715,7 +725,7 @@ uppermultibarlabels,groupgap}% \DTLdisplayuppermultibarlabel{\dtl@thisupperbarlabel}} \def\DTLmidpt{\pgfpointlineattime{0.5}{\DTLstartpt}{\DTLendpt}}% \DTLeverybarhook - \FPadd{\@dtl@start}{\@dtl@start}{1}% + \dtladd{\@dtl@start}{\@dtl@start}{1}% \advance\@dtl@barcount by 1\relax }% \setlength{\dtl@tmplength}{\DTLbarlabeloffset}% @@ -737,7 +747,7 @@ uppermultibarlabels,groupgap}% \fi \expandafter\pgftext\expandafter[\dtl@textopt]{% \DTLdisplaylowerbarlabel{\dtl@barlabel}} - \FPadd{\@dtl@start}{\@dtl@start}{\dtlbar@groupgap}% + \dtladd{\@dtl@start}{\@dtl@start}{\dtlbar@groupgap}% } \ifDTLbarxaxis \ifDTLverticalbars @@ -773,7 +783,7 @@ uppermultibarlabels,groupgap}% \fi \pgfusepath{stroke} \ifx\dtlbar@yticlabels\relax - \FPround{\dtl@thislabel}{\dtl@thistick} + \dtlround{\dtl@thislabel}{\dtl@thistick} {\c@DTLbarroundvar}% \else \dtl@chopfirst\dtlbar@yticlabels\dtl@thislabel\dtl@rest |