diff options
author | Xu Yuan <xu@informatik.hu-berlin.de> | 2011-10-02 18:05:36 +0200 |
---|---|---|
committer | Xu Yuan <xu@informatik.hu-berlin.de> | 2011-10-02 18:05:36 +0200 |
commit | 241871ce504828cf4a43c04511760e6392e39c59 (patch) | |
tree | 17c309640f90d9d8e7b1c347eb8ba65552b4e9f7 | |
parent | 75f6f91749edb3842581b4cda0003cdbfe5fe75d (diff) | |
download | pgf-pie-241871ce504828cf4a43c04511760e6392e39c59.tar.gz pgf-pie-241871ce504828cf4a43c04511760e6392e39c59.tar.bz2 pgf-pie-241871ce504828cf4a43c04511760e6392e39c59.zip |
cloud support explode
-rw-r--r-- | dev/pgf-pie.sty | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/dev/pgf-pie.sty b/dev/pgf-pie.sty index 549b521..c320d02 100644 --- a/dev/pgf-pie.sty +++ b/dev/pgf-pie.sty @@ -71,6 +71,18 @@ chart by using PGF/Tikz package.] } } +\newcommand{\pgfpie@findExplode}[1] +{ + \pgfmathparse{int(mod(#1,\value{pgfpie@explodeLength}))} + \let\ei\pgfmathresult + \foreach \e [count=\j from 0] in \explode { + \ifnum \j=\ei + \xdef\theexplode{\e} + \breakforeach + \fi + } +} + % #1: bottom left point % #2: size % #3: number @@ -264,10 +276,12 @@ chart by using PGF/Tikz package.] \else \ifcloud %%%%%%%%%% CLOUD PIE BGEIN %%%%%%%%%%% - \xdef\cloudGap{0.1} % drawing loop \foreach \p/\t [count=\i from 0] in {#2} { + % find explode + \pgfpie@findExplode{\i} + \def\cloudGap{\theexplode + 0.1} \pgfmathparse{sqrt(\p / \sum) * \radius} \let\cloudR\pgfmathresult \ifnum \i = 0 @@ -355,14 +369,7 @@ chart by using PGF/Tikz package.] \fi % find explode - \pgfmathparse{int(mod(\i,\value{pgfpie@explodeLength}))} - \let\ei\pgfmathresult - \foreach \e [count=\j from 0] in \explode { - \ifnum \j=\ei - \xdef\theexplode{\e} - \breakforeach - \fi - } + \pgfpie@findExplode{\i} % find color \pgfpie@findColor{\i} |