summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXu Yuan <xu@informatik.hu-berlin.de>2011-10-02 00:18:22 +0200
committerXu Yuan <xu@informatik.hu-berlin.de>2011-10-02 00:18:22 +0200
commit8b35c22097ca10a6ce43f9e566a0da76cbdf2d71 (patch)
tree1c6278442e036a456265d0fcf67d96946bf463cb
parentcac24b96a2690e8b2bc0f7cb4f55a53f9cc38579 (diff)
downloadpgf-pie-8b35c22097ca10a6ce43f9e566a0da76cbdf2d71.tar.gz
pgf-pie-8b35c22097ca10a6ce43f9e566a0da76cbdf2d71.tar.bz2
pgf-pie-8b35c22097ca10a6ce43f9e566a0da76cbdf2d71.zip
better legend position
-rw-r--r--dev/pgf-pie.sty10
1 files changed, 7 insertions, 3 deletions
diff --git a/dev/pgf-pie.sty b/dev/pgf-pie.sty
index e26c4fb..7407f90 100644
--- a/dev/pgf-pie.sty
+++ b/dev/pgf-pie.sty
@@ -152,11 +152,12 @@ chart by using PGF/Tikz package.]
\setcounter{pgfpie@angleEnd}{0}
+ \setcounter{pgfpie@sliceLength}{0}
+ \foreach \p/\e in {#2} { \addtocounter{pgfpie@sliceLength}{1} }
+
\ifpolar
- \setcounter{pgfpie@sliceLength}{0}
\xdef\maxValue{0}
\foreach \p/\e in {#2} {
- \addtocounter{pgfpie@sliceLength}{1}
\ifnum \maxValue < \p
\xdef\maxValue{\p}
\fi
@@ -208,7 +209,10 @@ chart by using PGF/Tikz package.]
% legend
\iflegend
- \coordinate[xshift=0.8cm] (legendpos) at (current bounding box.north east);
+ \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}
{