summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXu Yuan <xu@informatik.hu-berlin.de>2011-10-02 00:23:26 +0200
committerXu Yuan <xu@informatik.hu-berlin.de>2011-10-02 00:23:26 +0200
commitde7f2fde789d49f18c4642602fb3dddf6348a172 (patch)
tree7e328403ef2d24d9e9ac9b05f95435ab9b52ce14
parent8b35c22097ca10a6ce43f9e566a0da76cbdf2d71 (diff)
downloadpgf-pie-de7f2fde789d49f18c4642602fb3dddf6348a172.tar.gz
pgf-pie-de7f2fde789d49f18c4642602fb3dddf6348a172.tar.bz2
pgf-pie-de7f2fde789d49f18c4642602fb3dddf6348a172.zip
v0.1
-rw-r--r--release/pgf-pie-0.1/demo/before-after-number.tex3
-rw-r--r--release/pgf-pie-0.1/demo/color.tex6
-rw-r--r--release/pgf-pie-0.1/demo/colorwheel.tex3
-rw-r--r--release/pgf-pie-0.1/demo/explode.tex7
-rw-r--r--release/pgf-pie-0.1/demo/first-pie.tex3
-rw-r--r--release/pgf-pie-0.1/demo/legend.tex3
-rw-r--r--release/pgf-pie-0.1/demo/polar.tex3
-rw-r--r--release/pgf-pie-0.1/demo/population.tex27
-rw-r--r--release/pgf-pie-0.1/demo/radius.tex7
-rw-r--r--release/pgf-pie-0.1/demo/shadow.tex4
-rw-r--r--release/pgf-pie-0.1/demo/sum.tex5
-rw-r--r--release/pgf-pie-0.1/demo/text.tex3
-rw-r--r--release/pgf-pie-0.1/pgf-pie-manual.pdfbin0 -> 182750 bytes
-rw-r--r--release/pgf-pie-0.1/pgf-pie-manual.tex166
-rw-r--r--release/pgf-pie-0.1/pgf-pie.sty228
15 files changed, 468 insertions, 0 deletions
diff --git a/release/pgf-pie-0.1/demo/before-after-number.tex b/release/pgf-pie-0.1/demo/before-after-number.tex
new file mode 100644
index 0000000..0a50ebf
--- /dev/null
+++ b/release/pgf-pie-0.1/demo/before-after-number.tex
@@ -0,0 +1,3 @@
+\begin{tikzpicture}
+ \pie[before number={\$}, after number=,]{10/A, 20/B, 30/C, 40/D}
+\end{tikzpicture} \ No newline at end of file
diff --git a/release/pgf-pie-0.1/demo/color.tex b/release/pgf-pie-0.1/demo/color.tex
new file mode 100644
index 0000000..cb79b8c
--- /dev/null
+++ b/release/pgf-pie-0.1/demo/color.tex
@@ -0,0 +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/release/pgf-pie-0.1/demo/colorwheel.tex b/release/pgf-pie-0.1/demo/colorwheel.tex
new file mode 100644
index 0000000..1543fbe
--- /dev/null
+++ b/release/pgf-pie-0.1/demo/colorwheel.tex
@@ -0,0 +1,3 @@
+\begin{tikzpicture}
+ \pie{10/, 10/, 10/, 10/, 10/, 10/, 10/, 10/, 10/, 10/}
+\end{tikzpicture} \ No newline at end of file
diff --git a/release/pgf-pie-0.1/demo/explode.tex b/release/pgf-pie-0.1/demo/explode.tex
new file mode 100644
index 0000000..94c83fc
--- /dev/null
+++ b/release/pgf-pie-0.1/demo/explode.tex
@@ -0,0 +1,7 @@
+\begin{tikzpicture}
+ % 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/release/pgf-pie-0.1/demo/first-pie.tex b/release/pgf-pie-0.1/demo/first-pie.tex
new file mode 100644
index 0000000..e8c6376
--- /dev/null
+++ b/release/pgf-pie-0.1/demo/first-pie.tex
@@ -0,0 +1,3 @@
+\begin{tikzpicture}
+ \pie{10/A, 20/B, 30/C, 40/D}
+\end{tikzpicture} \ No newline at end of file
diff --git a/release/pgf-pie-0.1/demo/legend.tex b/release/pgf-pie-0.1/demo/legend.tex
new file mode 100644
index 0000000..f6665f6
--- /dev/null
+++ b/release/pgf-pie-0.1/demo/legend.tex
@@ -0,0 +1,3 @@
+\begin{tikzpicture}
+ \pie[text=legend]{10/First, 20/Second, 30/Third, 40/Fourth}
+\end{tikzpicture} \ No newline at end of file
diff --git a/release/pgf-pie-0.1/demo/polar.tex b/release/pgf-pie-0.1/demo/polar.tex
new file mode 100644
index 0000000..4d86872
--- /dev/null
+++ b/release/pgf-pie-0.1/demo/polar.tex
@@ -0,0 +1,3 @@
+\begin{tikzpicture}
+ \pie[polar]{10/A, 20/B, 30/C, 40/D}
+\end{tikzpicture} \ No newline at end of file
diff --git a/release/pgf-pie-0.1/demo/population.tex b/release/pgf-pie-0.1/demo/population.tex
new file mode 100644
index 0000000..1b39664
--- /dev/null
+++ b/release/pgf-pie-0.1/demo/population.tex
@@ -0,0 +1,27 @@
+% data from http://en.wikipedia.org/wiki/List_of_countries_by_population
+\begin{tikzpicture}
+ \pie[polar, sum=auto, radius=35, after number=, text=pin] {1339/China,
+ 1210/India, 312/USA, 237/Indonesia, 190/Brazil, 177/Pakistan,
+ 158/Nigeria, 151/Bangladesh, 142/Russia, 127/Japan, 112/Mexico,
+ 94/Philippines, 87/Vietnam, 82/Ethiopia, 81/Germany, 80/Egypt,
+ 75/Iran, 73/Turkey, 67/Thailand, 65/Congo, 65/France, 62/UK,
+ 60/Italy, 50/South Africa, 48/South Korea, 47/Myanmar, 46/Spain,
+ 46/Colombia, 45/Ukraine, 43/Tanzania, 40/Argentina, 38/Kenya,
+ 38/Poland, 36/Algeria, 34/Canada, 32/Morocco, 31/Uganda, 31/Iraq,
+ 31/Afghanistan, 30/Sudan, 29/Peru, 29/Venezuela, 28/Nepal,
+ 28/Malaysia, 27/Uzbekistan, 27/Saudi Arabia, 24/Ghana, 24/North
+ Korea, 23/Syria, 23/Taiwan, 22/Australia, 22/Yemen, 21/Romania,
+ 20/Madagascar, 20/Sri Lanka, 20/Mozambique, 19/Cote d'Ivoire,
+ 19/Cameroon, 19/Angola, 17/Chile, 16/Netherlands, 16/Kazakhstan,
+ 15/Burkina Faso, 15/Niger, 14/Malawi, 14/Mali, 14/Guatemala,
+ 14/Ecuador, 13/Cambodia, 13/Zambia, 12/Zimbabwe, 12/Senegal,
+ 11/Cuba, 11/Chad, 10/Belgium, 10/Greece, 10/Portugal, 10/Tunisia,
+ 10/Czech Republic, 10/Bolivia, 10/Rwanda, 10/Haiti, 10/Hungary,
+ 10/Guinea, 10/Belarus, 9/Sweden, 9/Dominican Republic, 9/Somalia,
+ 9/Azerbaijan, 9/Benin, 8/Austria, 8/Burundi, 8/United Arab
+ Emirates, 8/South Sudan, 8/Honduras, 8/Switzerland, 8/Israel,
+ 7/Bulgaria, 7/Serbia, 7/Hong Kong }
+
+ % \node[circle,draw=black,thick, fill=white, font=\bf]
+ % {Population of the world};
+\end{tikzpicture}
diff --git a/release/pgf-pie-0.1/demo/radius.tex b/release/pgf-pie-0.1/demo/radius.tex
new file mode 100644
index 0000000..944e218
--- /dev/null
+++ b/release/pgf-pie-0.1/demo/radius.tex
@@ -0,0 +1,7 @@
+\begin{tikzpicture}
+ \pie{10/, 20/, 30/, 40/}
+
+ \pie[pos={8,0}, rotate=180]{10/, 20/, 30/, 40/}
+
+ \pie[pos={17,0}, radius=4]{10/, 20/, 30/, 40/}
+\end{tikzpicture} \ No newline at end of file
diff --git a/release/pgf-pie-0.1/demo/shadow.tex b/release/pgf-pie-0.1/demo/shadow.tex
new file mode 100644
index 0000000..9ccfd9f
--- /dev/null
+++ b/release/pgf-pie-0.1/demo/shadow.tex
@@ -0,0 +1,4 @@
+% \usetikzlibrary{shadows}
+\begin{tikzpicture}
+ \pie[style=drop shadow]{10/A, 20/B, 30/C, 40/D}
+\end{tikzpicture}
diff --git a/release/pgf-pie-0.1/demo/sum.tex b/release/pgf-pie-0.1/demo/sum.tex
new file mode 100644
index 0000000..13e2b73
--- /dev/null
+++ b/release/pgf-pie-0.1/demo/sum.tex
@@ -0,0 +1,5 @@
+\begin{tikzpicture}
+ \pie[sum=auto, after number=, radius=2]{33/Boys, 7/Girls}
+
+ \pie[pos={6,0}, sum=40, after number=, radius=2]{33/Boys}
+\end{tikzpicture} \ No newline at end of file
diff --git a/release/pgf-pie-0.1/demo/text.tex b/release/pgf-pie-0.1/demo/text.tex
new file mode 100644
index 0000000..95ef108
--- /dev/null
+++ b/release/pgf-pie-0.1/demo/text.tex
@@ -0,0 +1,3 @@
+\begin{tikzpicture}
+ \pie[text=pin]{10/A, 20/B, 30/C, 40/D}
+\end{tikzpicture} \ No newline at end of file
diff --git a/release/pgf-pie-0.1/pgf-pie-manual.pdf b/release/pgf-pie-0.1/pgf-pie-manual.pdf
new file mode 100644
index 0000000..e071ca0
--- /dev/null
+++ b/release/pgf-pie-0.1/pgf-pie-manual.pdf
Binary files differ
diff --git a/release/pgf-pie-0.1/pgf-pie-manual.tex b/release/pgf-pie-0.1/pgf-pie-manual.tex
new file mode 100644
index 0000000..95a666f
--- /dev/null
+++ b/release/pgf-pie-0.1/pgf-pie-manual.tex
@@ -0,0 +1,166 @@
+% Manual of pgf-pie.sty, a convenient set of macros for drawing pie
+% chart. Written by Xu Yuan <xuyuan.cn@gmail.com> This file is part of
+% pgf-pie you may get it at http://code.google.com/p/pgf-pie/
+
+\documentclass{article}
+\usepackage[margin=12mm]{geometry}
+\usepackage{hyperref}
+
+\usepackage{pgf-pie}
+\usetikzlibrary{shadows}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\usepackage{listings}
+\usepackage{color}
+\definecolor{listinggray}{gray}{0.92}
+\lstset{ %
+language=[LaTeX]TeX,
+breaklines=true,
+frame=single,
+% frameround=tttt,
+basicstyle=\footnotesize\ttfamily,
+backgroundcolor=\color{listinggray},
+keywordstyle=\color{blue}
+}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\hypersetup{
+ colorlinks=true,
+ linkcolor=blue,
+ anchorcolor=black,
+ citecolor=olive,
+ filecolor=magenta,
+ menucolor=red,
+ urlcolor=blue
+}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\newcommand{\demo}[2][1]{
+ \begin{center}
+ \begin{tabular}{cc}
+ \begin{minipage}{.49\linewidth}
+ \centering
+ \resizebox{#1\linewidth}{!}{
+ \input{demo/#2}
+ }
+ \end{minipage}
+ &
+ \begin{minipage}{.45\linewidth}
+ \lstinputlisting{demo/#2}
+ \end{minipage}
+ \end{tabular}
+ \end{center}
+}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\newcommand{\example}[2][1]{
+ \begin{center}
+ \resizebox{#1\linewidth}{!}{
+ \input{demo/#2}
+ }
+ \end{center}
+ \lstinputlisting{demo/#2}
+}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\begin{document}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\title{Drawing Pie Chart by using \texttt{pgf-pie}}
+\author{\href{mailto:xuyuan.cn@gmail.com}{Yuan Xu}}
+\date{\today{}~(v0.1)}
+\maketitle
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\begin{abstract}
+ \texttt{pgf-pie} is a LaTeX package for drawing pie chart. As stated
+ by its name, it is based on a very popular graphic package
+ \texttt{PGF/TikZ}. This document presents the usage of
+ \texttt{pgf-pie} and collects some pie charts as examples.
+ \texttt{pgf-pie} can be downloaded from
+ \href{http://code.google.com/p/pgf-pie/}{http://code.google.com/p/pgf-pie/}.
+\end{abstract}
+
+\tableofcontents
+
+\section{The Essentials}
+
+\subsection{First Pie}
+\demo[0.6]{first-pie}
+
+\subsection{Polar area diagram}
+The polar area diagram is similar to a usual pie chart, except sectors
+are equal angles and differ rather in how far each sector extends from
+the center of the circle.
+
+\demo[0.6]{polar}
+
+\subsection{Position, Rotation, Size}
+
+The center of chart can be set by \texttt{pos}, default is
+\texttt{\{0,0\}}. The chart can be rotated by setting \texttt{rotate}
+(in degrees). The size of chart can be set by \texttt{radius}, default
+is 3.
+
+\demo{radius}
+
+\subsection{Explode}
+\demo{explode}
+
+\subsection{Text Label}
+
+\subsubsection{Text inside pie}
+\demo[0.6]{before-after-number}
+
+\subsubsection{Text outside pie}
+The value of \texttt{text} can be \texttt{label}(default),
+\texttt{pin} or \texttt{legend}.
+
+\demo[0.6]{text}
+
+\demo[0.6]{legend}
+
+\subsection{Sum}
+The value of \texttt{sum} indicats the sum of all data in the chart,
+it is 100 by default. It can be calculated automatically when
+\texttt{auto} is set.
+
+\demo{sum}
+
+\subsection{Color}
+The color can be specified by \texttt{color}, the default color wheel
+is shown in figure \ref{fig:color-wheel}.
+
+\demo{color}
+
+
+\begin{figure}
+ \centering
+ \input{demo/colorwheel}
+ \caption{Default color wheel}
+ \label{fig:color-wheel}
+\end{figure}
+
+
+\subsection{Style}
+\subsubsection{shadow}
+\demo[0.6]{shadow}
+
+\section{Examples}
+
+% \subsection{Population of the world}
+% \example{population}
+
+% \section{Acknowledgements}
+% Many people contributed to \texttt{pgf-pie} by reporting problems,
+% suggesting various improvements or submitting code. Here is a list of
+% these people:
+% \href{mailto:???}{name}.
+
+\end{document}
+%%% Local Variables:
+%%% mode: Tex-PDF
+%%% TeX-master: t
+%%% End:
diff --git a/release/pgf-pie-0.1/pgf-pie.sty b/release/pgf-pie-0.1/pgf-pie.sty
new file mode 100644
index 0000000..7407f90
--- /dev/null
+++ b/release/pgf-pie-0.1/pgf-pie.sty
@@ -0,0 +1,228 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Start of pgf-pie.sty
+%
+% Some LaTeX macros for pie chart by using PGF/Tikz package.
+% Home page of project: http://pgf-pie.googlecode.com/
+% Author: Xu Yuan <xuyuan.cn@gmail.com>
+%
+
+\NeedsTeXFormat{LaTeX2e}[1999/12/01]
+\ProvidesPackage{pgf-pie}[2011/10/01 v0.1 Some LaTeX macros for pie
+chart by using PGF/Tikz package.]
+
+\RequirePackage{tikz}
+\RequirePackage{ifthen}
+
+% args:
+% #1: begin angle
+% #2: end angle
+% #3: inner label
+% #4: outer label
+% #5: explode
+% #6: fill color
+% #7: radius
+% #8: center
+% #9: style
+\newcommand{\pgfpie@slice}[9]{
+ \pgfmathparse{0.5*(#1)+0.5*(#2)}
+ \let\midangle\pgfmathresult
+
+ \path (#8) -- ++(\midangle:#5) coordinate(O);
+
+ \pgfmathparse{#7+#5}
+ \let\radius\pgfmathresult
+
+ % slice
+ \draw[line join=round, fill=#6, #9] (O) -- ++(#1:#7) arc (#1:#2:#7) -- cycle;
+
+ % outer label
+ \iflegend
+ \else
+ \path (O) -- ++ (\midangle:\radius)
+ node[inner sep=0, \text=\midangle:#4]{};
+ \fi
+
+ % inner label
+ \pgfmathparse{min(((#2)-(#1)-10)/110*(-0.3),0)}
+ \let\temp\pgfmathresult
+ \pgfmathparse{(max(\temp,-0.5) + 0.8)*#7}
+ \let\innerpos\pgfmathresult
+ \path (O) -- ++(\midangle:\innerpos) node {#3};
+}
+
+\newcommand{\pgfpie@findColor}[1]
+{
+ \pgfmathparse{int(mod(#1,\value{pgfpie@colorLength}))}
+ \let\ci\pgfmathresult
+ \foreach \c [count=\j from 0] in \color {
+ \ifnum \j=\ci
+ \xdef\thecolor{\c}
+ \thecolor
+ \breakforeach
+ \fi
+ }
+}
+
+\newcounter{pgfpie@angleBegin}
+\newcounter{pgfpie@angleEnd}
+\newcounter{pgfpie@explodeLength}
+\newcounter{pgfpie@colorLength}
+\newcounter{pgfpie@sliceLength}
+
+\def\setexplode#1\pgfeov{\def\explode{#1}}
+\pgfkeyslet{/explode/.@cmd}{\setexplode}
+
+\def\setcolor#1\pgfeov{\def\color{#1}}
+\pgfkeyslet{/color/.@cmd}{\setcolor}
+
+\def\setradius#1\pgfeov{\def\radius{#1}}
+\pgfkeyslet{/radius/.@cmd}{\setradius}
+
+\def\setpos#1\pgfeov{\def\pos{#1}}
+\pgfkeyslet{/pos/.@cmd}{\setpos}
+
+\def\setstyle#1\pgfeov{\def\style{#1}}
+\pgfkeyslet{/style/.@cmd}{\setstyle}
+
+\def\setbeforenumber#1\pgfeov{\def\beforenumber{#1}}
+\pgfkeyslet{/before number/.@cmd}{\setbeforenumber}
+
+\def\setafternumber#1\pgfeov{\def\afternumber{#1}}
+\pgfkeyslet{/after number/.@cmd}{\setafternumber}
+
+\def\settext#1\pgfeov{\xdef\text{#1}}
+\pgfkeyslet{/text/.@cmd}{\settext}
+
+\def\setsum#1\pgfeov{\xdef\sum{#1}}
+\pgfkeyslet{/sum/.@cmd}{\setsum}
+
+\def\setrotate#1\pgfeov{\xdef\rotate{#1}}
+\pgfkeyslet{/rotate/.@cmd}{\setrotate}
+
+\newif\ifpolar
+\pgfkeys{/polar/.is if=polar}
+
+\newif\iflegend
+
+\newcommand{\pie}[2][]
+{
+ % load default parameters
+ \pgfkeys{
+ explode=0,
+ color={blue!60, cyan!60, yellow!60, orange!60, red!60,
+ blue!60!cyan!60, cyan!60!yellow!60, red!60!cyan!60,
+ red!60!blue!60, orange!60!cyan!60},
+ radius=3,
+ pos={0,0},
+ style={thick},
+ before number=,
+ after number=\%,
+ text=label,
+ sum=100,
+ rotate=0,
+ polar=false,
+ }
+ % load user's parameters
+ \pgfkeys{#1}
+
+ % legend or not
+ \ifthenelse{\equal{\text}{legend}}
+ {\legendtrue}
+ {\legendfalse}
+
+ % handle sum
+ \ifthenelse{\equal{\sum}{auto}}
+ {
+ % sum all input
+ \xdef\sum{0}
+ \foreach \p/\t in {#2}
+ {
+ \pgfmathparse{\sum + \p}
+ \xdef\sum{\pgfmathresult}
+ }
+ }
+ {}
+
+ % init counters
+ \setcounter{pgfpie@explodeLength}{0}
+ \foreach \e in \explode { \addtocounter{pgfpie@explodeLength}{1} }
+
+ \setcounter{pgfpie@colorLength}{0}
+ \foreach \c in \color { \addtocounter{pgfpie@colorLength}{1} }
+
+ \setcounter{pgfpie@angleEnd}{0}
+
+ \setcounter{pgfpie@sliceLength}{0}
+ \foreach \p/\e in {#2} { \addtocounter{pgfpie@sliceLength}{1} }
+
+ \ifpolar
+ \xdef\maxValue{0}
+ \foreach \p/\e in {#2} {
+ \ifnum \maxValue < \p
+ \xdef\maxValue{\p}
+ \fi
+ }
+ \pgfmathparse{\sum / \value{pgfpie@sliceLength}}
+ \xdef\polarangle{\pgfmathresult}
+ \pgfmathparse{\radius / \maxValue}
+ \xdef\polarRadiusUnit{\pgfmathresult}
+ \else
+ \xdef\theradius{\radius}
+ \fi
+
+ % drawing loop
+ \foreach \p/\t [count=\i from 0] in {#2}
+ {
+ \setcounter{pgfpie@angleBegin}{\value{pgfpie@angleEnd}}
+ \ifpolar
+ % Polar area diagram
+ \addtocounter{pgfpie@angleEnd}{\polarangle}
+ \xdef\theradius{\p*\polarRadiusUnit}
+ \else
+ % normal pie
+ \addtocounter{pgfpie@angleEnd}{\p}
+ \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
+ }
+
+ % find color
+ \pgfpie@findColor{\i}
+
+ \pgfpie@slice{\thepgfpie@angleBegin/\sum*360+\rotate}
+ {\thepgfpie@angleEnd/\sum*360+\rotate}
+ {\beforenumber \p \afternumber}
+ {\t}
+ {\theexplode}
+ {\thecolor}
+ {\theradius}
+ {\pos}
+ {\style}
+ }
+
+ % legend
+ \iflegend
+ \coordinate[xshift=0.8cm,
+ yshift=(\value{pgfpie@sliceLength}*0.5+1)*0.5cm] (legendpos) at
+ (current bounding box.east);
+
+ \begin{scope}[node distance=0.5cm]
+ \foreach \p/\t [count=\i from 0] in {#2}
+ {
+ \pgfpie@findColor{\i}
+ \node[draw, fill=\thecolor, \style, below of=legendpos, label=0:\t] (legendpos) {};
+ }
+ \end{scope}
+ \fi
+}
+
+%%% End of pgf-pie.sty
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+