summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXu Yuan <xu@informatik.hu-berlin.de>2011-10-01 13:40:02 +0200
committerXu Yuan <xu@informatik.hu-berlin.de>2011-10-01 13:40:02 +0200
commit1f28e4dc5f1f6d8e61fea4f10ea3d2451138c408 (patch)
treeb09d8d250e7e2f8608db23e6ec7c18ccbdf9da03
parent6c8152f6b203e3199b66de27be027c301e7aa60e (diff)
downloadpgf-pie-1f28e4dc5f1f6d8e61fea4f10ea3d2451138c408.tar.gz
pgf-pie-1f28e4dc5f1f6d8e61fea4f10ea3d2451138c408.tar.bz2
pgf-pie-1f28e4dc5f1f6d8e61fea4f10ea3d2451138c408.zip
bugfix in finding explode from array input
-rw-r--r--dev/demo/color.tex2
-rw-r--r--dev/demo/explode.tex7
-rw-r--r--dev/pgf-pie-manual.tex8
-rw-r--r--dev/pgf-pie.sty13
4 files changed, 20 insertions, 10 deletions
diff --git a/dev/demo/color.tex b/dev/demo/color.tex
index 974774a..cb79b8c 100644
--- a/dev/demo/color.tex
+++ b/dev/demo/color.tex
@@ -1,4 +1,6 @@
\begin{tikzpicture}
\pie[color={black!10, black!20, black!30, black!40}]
{10/A, 20/B, 30/C, 40/D}
+
+ \pie[pos={8,0}, color=blue!20] {10/A, 20/B, 30/C, 40/D}
\end{tikzpicture}
diff --git a/dev/demo/explode.tex b/dev/demo/explode.tex
index d47e49b..94c83fc 100644
--- a/dev/demo/explode.tex
+++ b/dev/demo/explode.tex
@@ -1,4 +1,7 @@
\begin{tikzpicture}
- \pie[explode={0, 0, 0, 0.1}]
- {10/A, 20/B, 30/C, 40/D}
+ % explode list
+ \pie[explode={0, 0, 0, 0.1}] {10/A, 20/B, 30/C, 40/D}
+
+ % explode all
+ \pie[pos={8,0}, explode=0.1] {10/A, 20/B, 30/C, 40/D}
\end{tikzpicture} \ No newline at end of file
diff --git a/dev/pgf-pie-manual.tex b/dev/pgf-pie-manual.tex
index 3933cb4..545b4d2 100644
--- a/dev/pgf-pie-manual.tex
+++ b/dev/pgf-pie-manual.tex
@@ -90,21 +90,21 @@ keywordstyle=\color{blue}
\subsection{First Pie}
\demo[0.6]{first-pie}
-\subsection{Explode}
-\demo[0.6]{explode}
-
\subsection{Radius, Position}
The size of chart can be set by \texttt{radius}, default is 3. The
center of chart can be set by \texttt{pos}, default is \texttt{\{0,0\}}.
\demo{radius}
+\subsection{Explode}
+\demo{explode}
+
\subsection{Label}
\demo[0.6]{before-after-number}
\subsection{Color}
-\demo[0.6]{color}
+\demo{color}
\subsection{Style}
\demo[0.6]{style}
diff --git a/dev/pgf-pie.sty b/dev/pgf-pie.sty
index a9347ad..ffbee97 100644
--- a/dev/pgf-pie.sty
+++ b/dev/pgf-pie.sty
@@ -80,7 +80,6 @@ chart by using PGF/Tikz package.]
}
\pgfkeys{#1}
- \def\explodearray{{\explode}}
\setcounter{pgfpie@explodeLength}{0}
\foreach \e in \explode { \addtocounter{pgfpie@explodeLength}{1} }
@@ -95,8 +94,14 @@ chart by using PGF/Tikz package.]
\addtocounter{pgfpie@angleEnd}{\p}
% find explode
- \pgfmathparse{\explodearray[int(mod(\i,\value{pgfpie@explodeLength}))]}
- \let\e\pgfmathresult
+ \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
+ }
% find color
\pgfmathparse{int(mod(\i,\value{pgfpie@colorLength}))}
@@ -112,7 +117,7 @@ chart by using PGF/Tikz package.]
{\thepgfpie@angleEnd/100*360}
{\beforenumber \p \afternumber}
{\t}
- {\e}
+ {\theexplode}
{\thecolor}
{\radius}
{\pos}