From ad44525af2f92d795a8cf0805f521145878fa203 Mon Sep 17 00:00:00 2001
From: Xu Yuan <xu@informatik.hu-berlin.de>
Date: Sat, 1 Oct 2011 15:43:25 +0200
Subject: shadow, pin text

---
 dev/pgf-pie.sty | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

(limited to 'dev/pgf-pie.sty')

diff --git a/dev/pgf-pie.sty b/dev/pgf-pie.sty
index ffbee97..5021851 100644
--- a/dev/pgf-pie.sty
+++ b/dev/pgf-pie.sty
@@ -27,11 +27,15 @@ chart by using PGF/Tikz package.]
   \let\midangle\pgfmathresult
 
   \path (#8) -- ++(\midangle:#5) coordinate(O);
+
+  \pgfmathparse{#7+#5}
+  \let\radius\pgfmathresult
+  
   % slice
   \draw[fill=#6, #9] (O) -- ++(#1:#7) arc (#1:#2:#7) -- cycle;
 
   % outer label
-  \path (O) -- ++ (\midangle:#7) node[label=\midangle:#4]{};
+  \path (O) -- ++ (\midangle:\radius) node[inner sep=0, \text=\midangle:#4]{};
 
   % inner label
   \pgfmathparse{min((#2-#1-10)/110*(-0.3),0)}
@@ -67,6 +71,9 @@ chart by using PGF/Tikz package.]
 \def\setafternumber#1\pgfeov{\def\afternumber{#1}}
 \pgfkeyslet{/after number/.@cmd}{\setafternumber}
 
+\def\settext#1\pgfeov{\xdef\text{#1}}
+\pgfkeyslet{/text/.@cmd}{\settext}
+
 \newcommand{\pie}[2][]
 {
   \pgfkeys{
@@ -77,6 +84,7 @@ chart by using PGF/Tikz package.]
     style={thick},
     before number=,
     after number=\%,
+    text=label,
   }
   \pgfkeys{#1}
 
-- 
cgit v1.2.3

