summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/pgf-pie
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2022-06-15 20:10:05 +0000
committerKarl Berry <karl@freefriends.org>2022-06-15 20:10:05 +0000
commit29ef80d3c855001d3deca15a21d4f6a49afb34b4 (patch)
treeb6bc8f919f237ea429a0cecbd39befa5b7dd6e09 /Master/texmf-dist/tex/latex/pgf-pie
parent9d4c1b9de597fee69892160a52c94592f5a62097 (diff)
pgf-pie (15jun22)
git-svn-id: svn://tug.org/texlive/trunk@63603 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/pgf-pie')
-rw-r--r--Master/texmf-dist/tex/latex/pgf-pie/pgf-pie.sty2
-rw-r--r--Master/texmf-dist/tex/latex/pgf-pie/tikzlibrarypie.code.tex26
2 files changed, 22 insertions, 6 deletions
diff --git a/Master/texmf-dist/tex/latex/pgf-pie/pgf-pie.sty b/Master/texmf-dist/tex/latex/pgf-pie/pgf-pie.sty
index 05e8e85ec50..ec8740ff2d0 100644
--- a/Master/texmf-dist/tex/latex/pgf-pie/pgf-pie.sty
+++ b/Master/texmf-dist/tex/latex/pgf-pie/pgf-pie.sty
@@ -1,6 +1,6 @@
% SPDX-License-Identifier: GPL-2.0-only OR LPPL-1.3c
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
-\ProvidesPackage{pgf-pie}[2021/07/30 v0.6 Some LaTeX macros for pie
+\ProvidesPackage{pgf-pie}[2022/06/14 v0.7 Some LaTeX macros for pie
chart by using PGF/Tikz package.]
\RequirePackage{tikz}
\usetikzlibrary{pie}
diff --git a/Master/texmf-dist/tex/latex/pgf-pie/tikzlibrarypie.code.tex b/Master/texmf-dist/tex/latex/pgf-pie/tikzlibrarypie.code.tex
index 6612fceb139..8b2963dd7aa 100644
--- a/Master/texmf-dist/tex/latex/pgf-pie/tikzlibrarypie.code.tex
+++ b/Master/texmf-dist/tex/latex/pgf-pie/tikzlibrarypie.code.tex
@@ -73,7 +73,12 @@
% slice
\draw[line join=round,fill={#6},\pgfpie@style] (pgfpie@O) -- ++({#1}:{#7}) arc ({#1}:{#2}:{#7}) -- cycle;
- \pgfmathparse{min(((#2)-(#1)-10)/110*(-0.3),0)}
+ \pgfpie@ifchangedirection{%
+ \pgfmathparse{min(((#1)-(#2)-10)/110*(-0.3),0)}
+ }{%
+ \pgfmathparse{min(((#2)-(#1)-10)/110*(-0.3),0)}
+ }%
+
\pgfmathparse{(max(\pgfmathresult,-0.5) + 0.8)*(#7)}
\let\pgfpie@innerpos\pgfmathresult
@@ -182,6 +187,9 @@
\pgfpie@newif{legend}
+\pgfpie@newif{changedirection}
+\pgfqkeys{/pgfpie}{change direction/.is if=pgfpie@changedirection}
+
\pgfpie@newif{square}
\pgfqkeys{/pgfpie}{square/.is if=pgfpie@square}
@@ -233,13 +241,14 @@
text=label,
sum=100,
rotate=0,
+ change direction=false,
polar=false,
square=false,
cloud=false,
scale font=false,
hide number=false,
hide label=false,
- every pie/.try,
+ every pie/.try,%
% load user's parameters
#1]
@@ -430,6 +439,9 @@
\xdef\pgfpie@theradius{\pgfpie@radius}%
}
+ \pgfpie@ifchangedirection{%
+ \pgfmathsetlength{\pgfpie@angleEnd}{\pgfpie@sum}
+ }{}%
\xdef\pgfpie@angleBegin{\the\pgfpie@angleEnd}
% drawing loop
\foreach \pgfpie@p/\pgfpie@t [count=\pgfpie@i from 0] in {#1}
@@ -441,9 +453,13 @@
\pgfmathparse{sqrt(\pgfpie@p) * (\pgfpie@polarRadiusUnit)}
\xdef\pgfpie@theradius{\pgfmathresult}
}{%
- % normal pie
- \pgfmathaddtolength{\pgfpie@angleEnd}{\pgfpie@p}
- }
+ % normal pie
+ \pgfpie@ifchangedirection{%
+ \pgfmathaddtolength{\pgfpie@angleEnd}{-(\pgfpie@p)}
+ }{%
+ \pgfmathaddtolength{\pgfpie@angleEnd}{\pgfpie@p}
+ }%
+ }%
% find explode
\pgfpie@findExplode{\pgfpie@i}