Debian Codegraph @

texmf-dist/doc/latex/wheelchart/wheelchart.tex

raw
1 %% wheelchart.tex
2 %% Copyright 2022-2026 Matthias Floré
3 %
4 % This work may be distributed and/or modified under the
5 % conditions of the LaTeX Project Public License, either version 1.3c
6 % of this license or (at your option) any later version.
7 % The latest version of this license is in
8 % http://www.latex-project.org/lppl.txt
9 % and version 1.3c or later is part of all distributions of LaTeX
10 % version 2005/12/01 or later.
11 %
12 % This work has the LPPL maintenance status `maintained'.
13 %
14 % The Current Maintainer of this work is Matthias Floré.
15 %
16 % This work consists of the files wheelchart.pdf, wheelchart.sty,
17 % wheelchart.tex and README.md.
18 \documentclass[a4paper,english,dvipsnames]{ltxdoc}
19 \usepackage[english]{babel}
20 \usepackage{graphicx}
21 \usepackage[a4paper,left=2.25cm,right=2.25cm,top=2.5cm,bottom=2.5cm]{geometry}
22 \usepackage{parskip}
23 \usepackage[page]{totalcount}%\totalpages or \getpagerefnumber{Thesourcecode}-1
24 \usepackage{mathtools}
25 \usepackage{amssymb}
26 \usepackage{interval}
27 \allowdisplaybreaks
28 \usepackage{tabularray}
29 \UseTblrLibrary{counter,siunitx}
30 \usepackage{listofitems}
31 \usepackage{pdflscape}
32 \usepackage{wheelchart}
33 \usetikzlibrary{decorations.markings,decorations.text,patterns}
34 \usepackage{tikzlings}
35 \input{pgfmanual-en-macros.tex}
36 %The environments commandmeta and commandmetameta and the macros \extractcommandmeta and \extractcommandmetameta below are modified from pgfmanual-en-macros.tex
37 \newenvironment{commandmeta}[2]{%
38 \begin{pgfmanualentry}%
39 \extractcommandmeta#1#2\@@%
40 \pgfmanualbody%
41 }%
42 {%
43 \end{pgfmanualentry}%
44 }
45 \def\extractcommandmeta#1#2\@@{%
46 \removeats{#1}%
47 \pgfmanualentryheadline{%
48 \pgfmanualpdflabel{\textbackslash\strippedat\meta{#2}}{}%
49 \declare{\expandafter\texttt\expandafter{\string#1\meta{#2}}}%
50 }%
51 \index{\strippedat\meta{#2} @\protect\myprintocmmand{\strippedat\meta{#2}}}%
52 }
53 \newenvironment{commandmetameta}[2]{%
54 \begin{pgfmanualentry}%
55 \extractcommandmetameta#1\@@#2\@@%
56 \pgfmanualbody%
57 }%
58 {%
59 \end{pgfmanualentry}%
60 }
61 \def\extractcommandmetameta#1\@@#2\@@{%
62 \pgfmanualentryheadline{%
63 \pgfmanualpdflabel{\textbackslash\meta{#1}\meta{#2}}{}%
64 \declare{\expandafter\texttt\expandafter{\textbackslash\meta{#1}\meta{#2}}}%
65 }%
66 \index{\meta{#1}\meta{#2} @\protect\myprintocmmand{\meta{#1}\meta{#2}}}%
67 }
68 \usepackage{codehigh}
69 \usepackage{fancyhdr}
70 \pagestyle{fancy}
71 \renewcommand{\headrulewidth}{0pt}
72 \addtolength{\headheight}{3pt}
73 \addtolength{\topmargin}{-3pt}
74 \fancyhead[L,R]{}
75 \fancyhead[C]{\iftotalpages\ifnum\thepage<\getpagerefnumber{Usage}\else \begin{tikzpicture}
76 \def\WCtotal{16.6}%21-<left=2.25cm>-<right=2.25cm>+2<gap polar=0.05>
77 \def\WCarrow{0.71}
78 \pgfkeys{
79 /wheelchart,
80 data=,
81 gap polar=0.05
82 }
83 \wheelchart[
84 etoc use name=wheelchart table of contents,
85 slices end arrow={\WCcount==\WCtotalcount?0:\WCarrow}{0},
86 slices start arrow={\WCcount==1?0:-\WCarrow}{0},
87 slices style=MidnightBlue!\fpeval{\thepage<\WCetocthepage||\thepage>=\WCetocthepage+\WCetocthenumberofpages?20:50},
88 value=\WCetocthenumberofpages,
89 xbar={\WCtotal}{0.4}
90 ]{}
91 \wheelchart[
92 at={({(\thepage -\getpagerefnumber{Usage})*\WCtotal/(\getpagerefnumber{Thesourcecode}-\getpagerefnumber{Usage})},0)},
93 slices end arrow={\thepage==\getpagerefnumber{Thesourcecode}-1?0:\WCarrow}{0},
94 slices start arrow={\thepage==\getpagerefnumber{Usage}?0:-\WCarrow}{0},
95 xbar={\WCtotal/(\getpagerefnumber{Thesourcecode}-\getpagerefnumber{Usage})}{0.4}
96 ]{1/PineGreen/}
97 \end{tikzpicture}\fi\fi}
98 \fancyfoot[C]{\ifdefined\fancyfootdefaultbox\begin{tikzpicture}[scale=0.15]
99 \useasboundingbox (-3,-3) rectangle (3,3);
100 \node[inner sep=0pt] {\usebox{\fancyfootdefaultbox}};%reusing the box compiles faster
101 %\wheelchart[
102 % gap,
103 % middle=\thepage,
104 % slices style=Gray,
105 % slices style{\thepage}=Cyan,
106 %% slices style={
107 %% /utils/exec=\pgfmathsetmacro{\WCcolor}{\thepage==\WCcount?"Cyan":"Gray"},
108 %% \WCcolor
109 %% },
110 % total count=\getpagerefnumber{Thesourcecode}-1%\totalpages
111 %]{}
112 \wheelchart[
113 gap,
114 middle=\thepage,
115 start angle=90-(\thepage-1)*(360/(\getpagerefnumber{Thesourcecode}-1)),%\totalpages
116 total angle=360/(\getpagerefnumber{Thesourcecode}-1)%\totalpages
117 ]{1/Cyan/}
118 \end{tikzpicture}\fi}
119 \usepackage{etoc}
120 \etocsettocstyle{\hypersetup{hidelinks}}{}
121 \etocglobaldefs
122 \usepackage[nottoc]{tocbibind}
123 \usepackage{imakeidx}
124 \makeindex[program=makeindex,columns=2,intoc=true]
125 \indexsetup{othercode={\thispagestyle{fancy}}}
126 %\PassOptionsToPackage{hyphens}{url}
127 \usepackage{xurl}
128 \AtEndPreamble{\hypersetup{%
129 linktoc=all,
130 pdfstartview=FitH,
131 colorlinks=true,
132 linkcolor=Mahogany,
133 citecolor=ForestGreen,
134 urlcolor=MidnightBlue,
135 bookmarksnumbered=true,
136 pdftitle=The wheelchart package,
137 pdfauthor=Matthias Floré,
138 pdfsubject=Manual,
139 pdfkeywords={bar chart,diagram,doughnut chart,infographic,pie chart,ring chart,square chart,sunburst chart,waffle chart,wheelchart,wheel chart}}}
140 \setcounter{tocdepth}{2}
141 \setcounter{secnumdepth}{2}
142 \title{The \texttt{wheelchart} package\\[12pt]\large Diagrams with circular or other shapes using \tikzname{} and \LaTeX3}
143 \author{Matthias Floré\\\href{mailto:[email protected]}{\texttt{[email protected]}}}
144 \date{Version 6.0 (2026/04/19)}%\\[12pt]
145 \begin{document}
146 \iftotalpages%
147 \newsavebox{\fancyfootdefaultbox}%
148 \begin{lrbox}{\fancyfootdefaultbox}%note the % to avoid extra space
149 \begin{tikzpicture}[scale=0.15]
150 \useasboundingbox (-3,-3) rectangle (3,3);
151 \wheelchart[
152 gap,
153 slices style=Gray,
154 total count=\getpagerefnumber{Thesourcecode}-1%\totalpages
155 ]{}
156 \end{tikzpicture}%note the % to avoid extra space
157 \end{lrbox}%
158 \fi%
159 \maketitle
160 \thispagestyle{fancy}
161 \begin{abstract}
162 \noindent This package is based on the package |tikz| (see \cite{TtTaPGFp}) and can be used to draw various kinds of diagrams such as bar charts, doughnut charts, infographics, pie charts, ring charts, square charts, sunburst charts, waffle charts and wheel charts.
163
164 \noindent It provides several options to customize the diagrams. It is also possible to specify a plot for the shape of the chart. Furthermore a legend can be added and the table of contents can be displayed as one of these diagrams.
165
166 \noindent Other tools for creating wheel charts or pie charts can be found in \cite{MpMP}, \cite{JhcIparowcltopotPGFm}, \cite{XdPCbupp}, \cite{RSVpaaMfp} and \cite{Ttdbdadm}.% This is the manual for version .
167 \end{abstract}
168 \section*{\contentsname}
169 \iftotalpages
170 \begin{codeexample}[preamble={%\usepackage[page]{totalcount}
171 \usepackage{etoolbox}
172 \usetikzlibrary{decorations.text}
173 \usepackage{etoc}
174 \etocsettocstyle{\hypersetup{hidelinks}}{}
175 \etocglobaldefs
176 \usepackage[linktoc=all]{hyperref}}]
177 \begin{tikzpicture}
178 \hypersetup{linkcolor=.}
179 \wheelchart[
180 after slices={
181 \pgfdeclareradialshading{WCshading}{\pgfpoint{0cm}{0cm}}{
182 color(0bp)=(WCcolor);
183 color(16.66666bp)=(WCcolor);%2/3 * 25bp
184 color(20.83333bp)=(WCcolor!10);%2.5/3 * 25bp
185 color(25bp)=(WCcolor);
186 color(50bp)=(WCcolor)
187 }
188 \shade[even odd rule,shading=WCshading] (0,0) circle[radius=3] circle[radius=2];
189 \endscope%end the scope for the clip operation so that the clipping area is reset
190 \draw[PineGreen,ultra thick,use path=\WCslicepath];
191 },
192 anchor ysep{7,8}=30,
193 before slices=\scope,%start a scope for the clip operation
194 data=
195 \textcolor{WCcolor}{
196 \textbf{\Large\ifdefempty{\WCetocthenumber}{}{\WCetocthelinkednumber{} }\WCetocthelinkedname}}\\
197 \textcolor{PineGreen}{page \WCetocthelinkedpage},
198 etoc count total pages=\getpagerefnumber{Thesourcecode}-1,%\totalpages
199 etoc level=section,
200 etoc name=wheelchart table of contents,%normally unnecessary but used to reuse this structure in the header
201 for loop start=\colorlet{WCcolor}{MidnightBlue!\fpeval{(\WCcount/\WCtotalcount)*100}},
202 gap,
203 lines,
204 lines style=PineGreen,
205 middle=\LARGE The\\[10pt]\huge\texttt{wheelchart}\\[10pt]\LARGE package,
206 slice{\getrefnumber{Keys}}={
207 arc={
208 draw=PineGreen,
209 ->
210 },
211 arc around text,
212 arc data=~Options for customization~,
213 arc data style={text color=PineGreen},
214 lines sep=0.5
215 },
216 slices style={
217 fill=none,
218 clip,
219 save path=\WCslicepath
220 },
221 start angle=0,
222 value=\WCetocthenumberofpages
223 ]{}
224 \end{tikzpicture}
225 \end{codeexample}
226 \fi
227 \section{Usage}\label{Usage}
228 The package |wheelchart| can be used by putting the following in the preamble.
229 \begin{codeexample}[code only]
230 \usepackage{wheelchart}
231 \end{codeexample}
232 The package |wheelchart| loads the package |tikz| and the \tikzname{} library |calc|.
233
234 Many examples in this manual use colors which can be defined by giving |dvipsnames| as an option to |\documentclass|.
235 \newpage%so that this section has its own block in the header
236 \section{The main macro}
237 \begin{command}{\wheelchart\opt{\oarg{options}}\marg{wheelchart data}}
238 This command can be placed inside a |tikzpicture| environment. It draws a wheelchart with \meta{wheelchart data}. With the initial settings, the \meta{wheelchart data} is a comma separated list in which each item corresponds to one slice of the wheelchart and consists of data separated by a |/|. The precise syntax of the \meta{wheelchart data} will be explained below. The \meta{options} can be given with the keys described in Section \ref{Keys}.
239 \begin{command}{\exampleforthismanual}
240 To simplify the creation of examples in this manual, we define the \meta{wheelchart data} below.
241 \begin{codeexample}[]
242 \gdef\exampleforthismanual{
243 14/Apricot/Apricot/{A, B, C, E, K}/north east lines/0/0/Gray/solid,
244 40/LimeGreen/Lime/{B, C}/grid/0/15/black/dashed,
245 20/Melon/Melon/{A, C}//0.5/0/none/densely dashed,
246 16/OliveGreen/Olive/{A, B, E, K}/dots/0/0/none/dotted,
247 28/Peach/Peach/{A, B, C, E, K}/fivepointed stars/0/0/Lavender/densely dotted,
248 32/Plum/Plum/{A, B, C, E, K}/bricks/0/-15/none/dash dot,
249 50/WildStrawberry/Strawberry/{B, C, E, K}//1/0/DarkOrchid/dash dot dot
250 }
251 \end{codeexample}%pattern crosshatch,checkerboard
252 \end{command}
253 The default wheelchart with these data is shown below.
254 \begin{codeexample}[width=10cm]
255 \begin{tikzpicture}
256 \wheelchart{\exampleforthismanual}
257 \end{tikzpicture}
258 \end{codeexample}
259 \end{command}
260 \newpage%so that this section has its own block in the header
261 \section{Additional macros}
262 \begin{command}{\WCangle\opt{\oarg{number}}\marg{angle pos}\marg{angle shift}\marg{pos}\marg{sep}}
263 This command gives the angle in degrees of the point which is constructed as follows.
264 \begin{enumerate}
265 \item Consider the inner start angle and the inner end angle of slice \meta{number}. This \meta{number} is computed modulo the total number of slices. Form the convex combination of these two angles with parameter \meta{angle pos}. Then add \meta{angle shift}. Then consider the point with this angle and as radius the inner radius.
266 \item Consider the similar point constructed with the outer start angle, the outer end angle and the outer radius of slice \meta{number}. Then construct the straight line between those two points.
267 \item Consider the radius given by the command |\WCradius| with arguments \meta{number}, \meta{pos} and \meta{sep}.
268 \item Consider the intersection of the previous line and the arc with the previous radius. The command |\WCangle| gives the angle in degrees of this point.
269 \end{enumerate}
270 The default value for \meta{number} is |\WCcount|.
271
272 The command |\WCangle| can be used in the \meta{options} of the command |\wheelchart|. It can also be used after the command |\wheelchart|. In that case, the computed angles will correspond to the last |\wheelchart|.
273
274 The command |\WCangle| should not be used with a plot.
275 \begin{codeexample}[preamble={\usepackage{siunitx}}]
276 \begin{tikzpicture}
277 \sisetup{round-mode=places,round-precision=2}
278 \wheelchart[
279 counterclockwise,
280 data=
281 slice \WCcount\\
282 inner start angle: \ang{\WCangle{0}{0}{0}{0}}\\
283 inner end angle: \ang{\WCangle{1}{0}{0}{0}}\\
284 outer start angle: \ang{\WCangle{0}{0}{1}{0}}\\
285 outer end angle: \ang{\WCangle{1}{0}{1}{0}}\\
286 inner radius: \WCradius{0}{0}\\
287 outer radius: \WCradius{1}{0},
288 gap=0.2,
289 inner radius{list}={2.2,2,1.8},
290 legend entry={
291 \fill[Dandelion] (\WCcoordinate[\WCcount +1]{inner start}) circle[radius=4pt];
292 \fill[RubineRed] (\WCcoordinate{inner end}) circle[radius=4pt];
293 \fill[YellowGreen] (\WCcoordinate[\WCcount +1]{outer start}) circle[radius=4pt];
294 \fill[RoyalPurple] (\WCcoordinate{outer end}) circle[radius=4pt];
295 \draw[->,dashed] (\WCpoint[\WCcount -1]{0.6}{0}{0.5}{0})--(\WCpoint{0.4}{0}{0.5}{0});
296 \draw[dashed] (\WCcoordinate{inner end})
297 --(\WCpoint{1}{0}{1}{\WClistsep}) coordinate (A);
298 \draw[dashed] (\WCcoordinate[\WCcount +1]{inner start})
299 --(\WCpoint[\WCcount +1]{0}{0}{1}{1}) coordinate (B);
300 \draw[<->] (A)--(B) node[\WClistpos,midway] {gap};
301 },
302 outer radius{list}={2.8,3,3.2},
303 slices style{list}={Gray!25,Gray!50,Gray!75},
304 start angle=0,
305 total count=3,
306 WClistpos={above left,below left,right},
307 WClistsep={1.2,1.2,0.6}
308 ]{}
309 \node[align=left] (N) at (-1.5,-6.5) {
310 The outer end angle of slice 2 is \ang{\WCangle[2]{1}{0}{1}{0}}.\\
311 The outer radius of slice 3 is \WCradius[3]{1}{0}.
312 };
313 \draw[->] (\WCcoordinate[2]{outer end})--(N) node[left,pos=0.7,align=left]
314 {These can be referenced\\after the command \textbackslash wheelchart};
315 \draw[->] (\WCpoint[3]{0.2}{0}{1}{0})--(N);
316 \end{tikzpicture}
317 \end{codeexample}
318 \end{command}
319 \begin{command}{\WCcoordinate\opt{\oarg{number}}\marg{name}}
320 \begin{itemize}
321 \item If the key |discrete| is false then this command gives the coordinate positioned at \meta{name} of slice \meta{number}. The \meta{name} can be |inner end|, |inner start|, |outer end| or |outer start|.
322 \item If the key |discrete| is true then this command gives the coordinate positioned at point \meta{name} of slice \meta{number}. The \meta{name} can be an integer from 1 till the number of points of slice \meta{number}.
323 \end{itemize}
324 The \meta{number} is computed modulo the total number of slices.
325
326 The default value for \meta{number} is |\WCcount|.
327
328 The command |\WCcoordinate| can be used in the \meta{options} of the command |\wheelchart|. It can also be used after the command |\wheelchart|. In that case, the coordinate will correspond to the last |\wheelchart|.
329 \end{command}
330 \begin{command}{\WCcount}
331 This macro gives the current number of the slice in the \meta{wheelchart data}.
332 \end{command}
333 \begin{command}{\WCcountdiscrete}
334 If the key |discrete| is true then this macro gives the current number of the \tikzname{} pic from the key |discrete pic|.
335 \end{command}
336 \begin{command}{\WCdataangle}
337 This macro is similar to |\WCmidangle| but also takes into account the keys |data angle pos|, |data angle shift|, |data pos| and |data sep| (with respect to the key |counterclockwise|).
338 \end{command}
339 \begin{command}{\WCetocthelinkedname}
340 \end{command}
341 \begin{command}{\WCetocthelinkednumber}
342 \end{command}
343 \begin{command}{\WCetocthelinkedpage}
344 \end{command}
345 \begin{command}{\WCetocthename}
346 \end{command}
347 \begin{command}{\WCetocthenumber}
348 \end{command}
349 \begin{command}{\WCetocthenumberofpages}
350 \end{command}
351 \begin{command}{\WCetocthepage}
352 \end{command}
353 These macros are defined when the key |etoc level| is used.
354 \begin{command}{\WClegend}
355 If the key |legend row| is used then the resulting legend is stored in the macro |\WClegend|.
356 \end{command}
357 \begin{commandmeta}{\WClist}{name}
358 This macro is defined when the key |WClist|\meta{name} is used and gives the element in the \meta{list} given to the key |WClist|\meta{name} with as index |\WCcount| modulo the length of this \meta{list}. The \meta{name} is the one given to the key |WClist|\meta{name}.
359 \end{commandmeta}
360 \begin{command}{\WCmidangle}
361 This macro gives the angle in degrees modulo $360$ of the middle of the current slice.
362 \begin{codeexample}[width=10cm,preamble={\usepackage{siunitx}}]
363 \begin{tikzpicture}
364 \wheelchart[
365 data angle shift=\WCvarG,
366 data style={
367 rotate=\WCdataangle,
368 draw=Magenta,
369 fill=GreenYellow,
370 right,
371 text=Gray
372 },
373 inner data=\ang{\WCmidangle},
374 inner data style={
375 rotate=\WCmidangle,
376 font=\ttfamily
377 }
378 ]{\exampleforthismanual}
379 \end{tikzpicture}
380 \end{codeexample}
381 \end{command}
382 \begin{command}{\WCperc}
383 This macro displays |\WCpercentagerounded| followed by a \unit{\percent} symbol.
384
385 If the package |siunitx| is loaded then the following code is used outside the key |arc data|. The package |siunitx| can be loaded before or after the package |wheelchart|.
386 \begin{codeexample}[code only]
387 \qty{\WCpercentagerounded}{\percent}
388 \end{codeexample}
389 If the package |siunitx| is not loaded then the following code is used outside the key |arc data|.
390 \begin{codeexample}[code only]
391 \WCpercentagerounded\,\%
392 \end{codeexample}
393 Inside the key |arc data|, the following code is used.
394 \begin{codeexample}[code only]
395 \WCpercentagerounded{\,}{\%}
396 \end{codeexample}
397 \end{command}
398 \begin{command}{\WCpercentage}
399 This macro gives the percentage of the current slice where the total is computed with the values of the key |value|. Note that rounding errors can occur.
400 \begin{codeexample}[width=10cm,preamble={\usepackage{siunitx}}]
401 \begin{tikzpicture}
402 \wheelchart[
403 data=\WCvarC\\\WCperc,
404 slices style=
405 \WCvarB!\fpeval{4*\WCpercentage}
406 ]{\exampleforthismanual}
407 \end{tikzpicture}
408 \end{codeexample}
409 \end{command}
410 \begin{command}{\WCpercentagerounded}
411 This macro displays |\WCpercentage| rounded up to the number of decimals determined by the key |perc precision|.
412 \end{command}
413 \begin{command}{\WCpoint\opt{\oarg{number}}\marg{angle pos}\marg{angle shift}\marg{pos}\marg{sep}}
414 This command gives the point where the angle is determined by |\WCangle| and the radius by |\WCradius| computed with the given arguments.
415
416 The \meta{number} is computed modulo the total number of slices.
417
418 The default value for \meta{number} is |\WCcount|.
419
420 The command |\WCpoint| can be used in the \meta{options} of the command |\wheelchart|. It can also be used after the command |\wheelchart|. In that case, the point will correspond to the last |\wheelchart|.
421
422 The command |\WCpoint| should not be used with a plot.
423 \end{command}
424 \begin{command}{\WCradius\opt{\oarg{number}}\marg{pos}\marg{sep}}
425 This command gives the convex combination with parameter \meta{pos} of the inner radius of slice \meta{number} minus \meta{sep} and the outer radius of slice \meta{number} plus \meta{sep}.
426
427 The \meta{number} is computed modulo the total number of slices.
428
429 The default value for \meta{number} is |\WCcount|.
430
431 The command |\WCradius| can be used in the \meta{options} of the command |\wheelchart|. It can also be used after the command |\wheelchart|. In that case, the computed radius will correspond to the last |\wheelchart|.
432
433 The command |\WCradius| should not be used with a plot.
434 \end{command}
435 \begin{command}{\WCtotalcount}
436 This macro gives the total number of slices.
437 \end{command}
438 \begin{command}{\WCtotalnum}
439 This macro gives the sum of all values of the key |value|.
440 \begin{codeexample}[width=10cm]
441 \begin{tikzpicture}
442 \wheelchart[
443 data=\WCvarC: \WCvarA,
444 middle=
445 \huge\textbf{Fruit}\\
446 \WCtotalcount{} species\\
447 \WCtotalnum{} pieces
448 ]{\exampleforthismanual}
449 \end{tikzpicture}
450 \end{codeexample}
451 \end{command}
452 \begin{command}{\WCvarA}
453 \end{command}
454 \begin{command}{\WCvarB}
455 \end{command}
456 \begin{command}{\WCvarC}
457 \end{command}
458 \begin{commandmetameta}{prefix}{name}
459 The \meta{wheelchart data} in the command |\wheelchart| is a list in which the items are separated by the value of the key |separator rows|. Each item in this list corresponds to one slice of the wheelchart and consists of data separated by the value of the key |separator columns|. With the initial settings, these individual data are interpreted as the macros |\WCvarA|, |\WCvarB|, |\WCvarC|, \dots, |\WCvarZ|, |\WCvarAA| and so on and can be accessed within the \meta{options} of the command |\wheelchart| if applicable.
460
461 The names of these macros can be specified with \meta{prefix} and \meta{name} which are determined by respectively the keys |header prefix| and |header|.
462
463 Initially, only |\WCvarA|, |\WCvarB| and |\WCvarC| are used for |value=\WCvarA|, |slices style=\WCvarB| and |data=\WCvarC|.
464
465 Other ways to specify data are by using for example a list such as an array with the package |tikz|, a list with the package |listofitems| or with the key |WClist|\meta{name}.
466 \begin{codeexample}[width=10cm,preamble={\usetikzlibrary{patterns}}]
467 \begin{tikzpicture}
468 \pgfkeys{
469 /wheelchart,
470 gap,
471 header={value,color,text,vitamins,pattern,explode,data angle shift,border},
472 header prefix=my,
473 value=1
474 }
475 \wheelchart[
476 data=,
477 radius={0.5}{3},
478 slices style={\mycolor!70,draw=\myborder,ultra thick,pattern=\mypattern,pattern color=\mycolor!70},
479 wheel data=\mytext,
480 % wheel data style={shift={(\WCmidangle:0.5)}},
481 % wheel data pos=0.5
482 ]{\exampleforthismanual}
483 \wheelchart[
484 data=\textcolor{\mycolor}{Vitamins}\\\myvitamins,
485 radius={3.1}{4},
486 slices arrow={1}{0.2},
487 slices style=\mycolor
488 ]{\exampleforthismanual}
489 \end{tikzpicture}
490 \end{codeexample}
491 \end{commandmetameta}
492 \section{Keys}\label{Keys}
493 The keys in this Section can be given as \meta{options} to the command |\wheelchart|.
494
495 If applicable, an optional non-empty \meta{range} between braces can be given to a key after the \meta{key name} except for the key |slice| where the \meta{range} is mandatory. This \meta{range} is processed with |\foreach| with the option |parse=true|. Hereafter the elements are processed with |\fp_eval:n|. If such a \meta{range} is given to a key then the options given to this key will only be applied to a slice if the number of the slice is in the \meta{range}. The \meta{range} only makes sense for a key which is processed for each slice. For example, the \meta{range} does not make sense for the key |middle|.
496
497 Furthermore, it is possible to add |{list}| after the \meta{key name}. Then a list can be given to the key. This list is processed analogously as how the key |WClist|\meta{name} works. Then the result is given to the key.
498
499 Below are some examples for the options \meta{range} and |{list}|.
500 \begin{itemize}
501 \item The following wheelchart can be obtained with the 3 possibilities below.
502 \begin{codeexample}[width=10cm]
503 \begin{tikzpicture}
504 \wheelchart[
505 data{list}={
506 An,example,where,some,of,the,
507 keys,are,given,using,a,list
508 },
509 slices style{list}={
510 Thistle,Orchid,Fuchsia
511 },
512 total count=12
513 ]{}
514 \end{tikzpicture}
515 \end{codeexample}
516 \begin{codeexample}[code only,preamble={\usepackage{listofitems}}]
517 \readlist\WCcolors{Thistle,Orchid,Fuchsia}
518
519 \setsepchar{ }
520 \readlist\WCdata{An example where some of the keys are given using a list}
521
522 data=\WCdata[\WCcount],
523
524 slices style={
525 /utils/exec=\pgfmathsetmacro{\WCcolornumber}{int(Mod(\WCcount-1,\WCcolorslen)+1)},
526 \WCcolors[\WCcolornumber]
527 },
528
529 total count=\WCdatalen,
530 \end{codeexample}
531 \begin{codeexample}[code only]
532 slices style{1,4,...,\WCdatalen}=Thistle,
533 slices style{2,5,...,\WCdatalen}=Orchid,
534 slices style{3,6,...,\WCdatalen}=Fuchsia,
535 \end{codeexample}
536 \item The following wheelchart can be obtained with the 3 possibilities below.
537 \begin{codeexample}[width=10cm]
538 \begin{tikzpicture}
539 \wheelchart[
540 explode=\WCvarF,
541 pie
542 ]{\exampleforthismanual}
543 \end{tikzpicture}
544 \end{codeexample}
545 \begin{codeexample}[code only]
546 explode={\WCcount==3?0.5:(\WCcount==7?1:0)},
547 \end{codeexample}
548 \begin{codeexample}[code only]
549 explode{3}=0.5,
550 explode{7}=1,
551 \end{codeexample}
552 \end{itemize}
553 \begin{key}{/wheelchart/after slices=\marg{code} (initially \normalfont empty)}
554 The \meta{code} given to this key will be executed after each slice of the wheelchart.
555 \end{key}
556 \begin{key}{/wheelchart/anchor xsep=\marg{angle} (initially 5)}
557 \end{key}
558 \begin{key}{/wheelchart/anchor ysep=\marg{angle} (initially 5)}
559 These keys determine the default anchor of the key |data| in the case that |lines ext=0|. Note that rounding errors can occur in the computation of the angle which is used to determine the default anchor according to Table \ref{tableanchorofthekeydatainthecasethatlinesextequaltozero}.
560 \begin{table}[ht]
561 \centering
562 \begin{tabular}{ll}
563 & Anchor of the key |data|\\
564 Angle (up to rounding errors) & in the case that |lines ext=0|\\\hline
565 $0$ & west\\
566 $90$ & south\\
567 $180$ & east\\
568 $270$ & north\\
569 For other angles not in $\{0,90,180,270\}$: & \\
570 $[0,\text{|anchor ysep|}]$ & west\\
571 $\ointerval{\text{|anchor ysep|}}{90-\text{|anchor xsep|}}$ & south west\\
572 $[90-\text{|anchor xsep|},90+\text{|anchor xsep|}]$ & south\\
573 $\ointerval{90+\text{|anchor xsep|}}{180-\text{|anchor ysep|}}$ & south east\\
574 $[180-\text{|anchor ysep|},180+\text{|anchor ysep|}]$ & east\\
575 $\ointerval{180+\text{|anchor ysep|}}{270-\text{|anchor xsep|}}$ & north east\\
576 $[270-\text{|anchor xsep|},270+\text{|anchor xsep|}]$ & north\\
577 $\ointerval{270+\text{|anchor xsep|}}{360-\text{|anchor ysep|}}$ & north west\\
578 $[360-\text{|anchor ysep|},360]$ & west\\
579 \end{tabular}
580 \caption{Anchor of the key \texttt{data} in the case that \texttt{lines ext=0}.}\label{tableanchorofthekeydatainthecasethatlinesextequaltozero}
581 \end{table}
582 \begin{codeexample}[width=10cm,preamble={\usepackage{siunitx}}]
583 \begin{tikzpicture}
584 \wheelchart[
585 anchor xsep=10,
586 anchor ysep=15,
587 data=\WCvarA,
588 data angle pos=\WClistdap,
589 inner data=\ang{\WClistvalue},
590 inner data angle pos=\WClistdap,
591 inner data sep=0.3,
592 lines=0.5,
593 lines angle pos=\WClistdap,
594 slices style{list}={
595 Maroon,SeaGreen,Maroon
596 },
597 value=\WClistvalue,
598 WClistdap={0.9,0.5,0.1},
599 WClistvalue={10,65,15,15,65,10}
600 ]{
601 south,
602 south west,
603 west,
604 west,
605 north west,
606 north,
607 north,
608 north east,
609 east,
610 east,
611 south east,
612 south
613 }
614 \end{tikzpicture}
615 \end{codeexample}
616 The anchor of the |data| can also be specified manually by setting the \meta{position} in the key |data style|.
617 \end{key}
618 \begin{stylekey}{/wheelchart/arc=\marg{options} (initially \normalfont empty)}
619 If this key is set then an arc with the style determined by this key will be drawn following the arc or plot for a slice of the wheelchart.
620 \end{stylekey}
621 \begin{key}{/wheelchart/arc around line=\marg{number} (initially 1)}
622 The contents of the key |arc data| can consist of multiple lines separated by |\\|. If the key |arc around text| is true then the corresponding line is determined by \meta{number}.
623 \end{key}
624 \begin{key}{/wheelchart/arc around text=\opt{\meta{boolean}} (default true, initially false)}
625 If true then the arc with the style determined by the key |arc| will be split in two parts such that the gap between these two parts leaves space for the contents of line \meta{number} of the key |arc data| where \meta{number} is determined by the key |arc around line|. The space between the arc and the contents of the key |arc data| can be increased with for example |~| in |arc data=~text~|.
626 \end{key}
627 \begin{key}{/wheelchart/arc data=\marg{text} (initially \normalfont empty)}
628 This key contains the \meta{text} which will be placed following the arc or plot for a slice of the wheelchart using the decoration |text along path|. This requires the \tikzname{} library |decorations.text|. The style of this decoration is given as follows. First, the option |raise=-0.5ex| is given. Then |text align| is determined by the key |arc data align|. Thereafter, the style of the key |arc data style| is added.
629
630 The \meta{text} can consist of multiple lines separated by |\\|.
631
632 Braces or multiple pairs of braces are required around some macros.
633 \end{key}
634 \begin{key}{/wheelchart/arc data align=\mchoice{center,left,right} (initially center)}
635 This key determines the alignment of the contents of the key |arc data|.
636 \end{key}
637 \begin{key}{/wheelchart/arc data angle pos=\marg{value} (initially 0.5)}
638 \end{key}
639 \begin{key}{/wheelchart/arc data angle shift=\marg{angle} (initially 0)}
640 These keys determine the position of the contents of the key |arc data| similar as the corresponding keys for the key |data|.
641 \end{key}
642 \begin{key}{/wheelchart/arc data dir=\marg{value} (initially 1)}
643 This key determines the direction of the contents of the key |arc data|. If the \meta{value} is positive then the direction is the same as the direction of the slice. If the \meta{value} is negative then the direction is reversed. The values |1| and |-1| are recommended.
644
645 When the contents of the key |arc data| is placed, the corresponding domain for the arc or plot is estimated. A warning is given when the contents of the key |arc data| did (possibly) not fit. In this case, the absolute value of the key |arc data dir| should be increased.
646
647 If an error |Dimension too large| occurs then the absolute value of the key |arc data dir| should be increased or decreased depending on the situation.
648 \end{key}
649 \begin{key}{/wheelchart/arc data expand=\marg{expansion type} (initially n)}
650 The contents of the key |arc data| can consist of multiple lines separated by |\\|. This splitting is done with |\seq_set_split:Nnn| or a variant thereof depending on the \meta{expansion type} which determines the last letter in the signature. For most use cases, this \meta{expansion type} is |n|, |e| or |f|.
651
652 In the example below, it is necessary to use |arc data expand=e| and to place |\noexpand| before |\bfseries|.
653 \catcode`|=12%
654 \begin{codeexample}[width=10cm,preamble={\usetikzlibrary{decorations.text}}]
655 \begin{tikzpicture}
656 \wheelchart[
657 arc data=|\noexpand\bfseries|\WCvarC\\
658 \WCvarD,
659 arc data expand=e,
660 arc data pos=0.5,
661 data=,
662 start angle=135,
663 total angle=90
664 ]{1/VioletRed/bold text/two\\lines}
665 \end{tikzpicture}
666 \end{codeexample}
667 \catcode`|=13%
668 \end{key}
669 \begin{key}{/wheelchart/arc data line sep factor=\marg{factor} (initially 1)}
670 The contents of the key |arc data| can consist of multiple lines separated by |\\|. The \meta{factor} determines the spacing between these lines.
671 \end{key}
672 \begin{key}{/wheelchart/arc data lines pos=\marg{factor} (initially 0.5)}
673 \end{key}
674 \begin{key}{/wheelchart/arc data lines shift=\marg{value} (initially 0)}
675 The positioning of the lines of the key |arc data| is determined by the index $k-1-\text{|arc data lines pos|}\cdot(N-1)+\text{|arc data lines shift|}$ where $N$ is the number of lines and $k\in\{1,\dots,N\}$.
676 \end{key}
677 \begin{key}{/wheelchart/arc data pos=\marg{value} (initially 1)}
678 \end{key}
679 \begin{key}{/wheelchart/arc data sep=\marg{value} (initially 1ex/1cm)}
680 These keys determine the position of the contents of the key |arc data| similar as the corresponding keys for the key |data|.
681 \end{key}
682 \begin{stylekey}{/wheelchart/arc data style=\marg{options} (initially \normalfont empty)}
683 This key accepts a list of keys which will be applied to the decoration for the key |arc data|.
684 \end{stylekey}
685 \begin{stylekey}{/wheelchart/arc first half=\marg{options} (initially \normalfont empty)}
686 If |arc around text| is true then the arc with the style determined by the key |arc| will be split in two parts. The style determined by the key |arc first half| will be appended to the first half of the arc.
687 \end{stylekey}
688 \begin{key}{/wheelchart/arc pos=\marg{value} (initially 1)}
689 This key determines the position of the arc similar as the corresponding key for the key |data|.
690 \end{key}
691 \begin{stylekey}{/wheelchart/arc second half=\marg{options} (initially \normalfont empty)}
692 This key is similar to the key |arc first half| but will be appended to the second half of the arc.
693 \end{stylekey}
694 \begin{key}{/wheelchart/arc sep=\marg{value} (initially 1ex/1cm)}
695 This key determines the position of the arc similar as the corresponding key for the key |data|. Note that the actual distance is given by |0.5ex/1cm| plus |arc sep| to match the option |raise=-0.5ex| given to the decoration for the key |arc data|.
696 \begin{codeexample}[width=10cm,preamble={\usetikzlibrary{decorations.text}}]
697 \begin{tikzpicture}
698 \wheelchart[
699 arc=\WCvarB,
700 arc around line=2,
701 arc around text,
702 arc data=
703 slice \WCcount\\
704 {~}\WCvarC{~}\\
705 \WCperc,
706 arc data dir=\WCmidangle<180?1:-1,
707 arc data expand=f,
708 arc data pos=1.3,
709 arc data style={text color=\WCvarB},
710 arc first half=dashed,
711 arc pos=1.3,
712 arc second half=->,
713 data=
714 ]{\exampleforthismanual}
715 \useasboundingbox (0,0)
716 circle[radius=4.3];
717 \end{tikzpicture}
718 \end{codeexample}
719 \end{key}
720 \begin{key}{/wheelchart/at=\marg{point} (initially (0,0))}
721 This key defines the center of the wheelchart.
722 \end{key}
723 \begin{key}{/wheelchart/before slices=\marg{code} (initially \normalfont empty)}
724 The \meta{code} given to this key will be executed before each slice of the wheelchart.
725 \end{key}
726 \begin{key}{/wheelchart/caption=\marg{text} (initially \normalfont empty)}
727 This key contains the \meta{text} which will be placed below the wheelchart. The \meta{text} is placed in a node. The $x$ coordinate of this node is the $x$ coordinate of the center of the wheelchart, which is defined by the key |at|. In general, this is \emph{not} the same as the $x$ coordinate of the center of the |local bounding box| around the wheelchart. The $y$ coordinate of this node is at a value determined by the key |caption sep| below the south of the |local bounding box| around the wheelchart. The style of this node is given as follows. First, the options |anchor=north,align=center| are given. Thereafter, the style of the key |caption style| is added.
728 \end{key}
729 \begin{key}{/wheelchart/caption left=\marg{text} (initially \normalfont empty)}
730 This key contains the \meta{text} which will be placed below left of the wheelchart. The \meta{text} is placed in a node. This node is placed at a value determined by the key |caption left sep| below the south west of the |local bounding box| around the wheelchart. The style of this node is given as follows. First, the options |anchor=north west,align=left| are given. Thereafter, the style of the key |caption left style| is added.
731 \end{key}
732 \begin{key}{/wheelchart/caption left sep=\marg{value} (initially 0.5)}
733 The node where the contents of the key |caption left| is placed is at \meta{value} below the south west of the |local bounding box| around the wheelchart.
734 \end{key}
735 \begin{stylekey}{/wheelchart/caption left style=\marg{options} (initially \normalfont empty)}
736 This key accepts a list of keys which will be applied to the node where the contents of the key |caption left| is placed.
737 \end{stylekey}
738 \begin{key}{/wheelchart/caption sep=\marg{value} (initially 0.5)}
739 The $y$ coordinate of the node where the contents of the key |caption| is placed is at \meta{value} below the south of the |local bounding box| around the wheelchart.
740 \end{key}
741 \begin{stylekey}{/wheelchart/caption style=\marg{options} (initially \normalfont empty)}
742 This key accepts a list of keys which will be applied to the node where the contents of the key |caption| is placed.
743 \begin{codeexample}[width=10cm]
744 \begin{tikzpicture}
745 \wheelchart[
746 caption=Caption,
747 caption style={font=\scshape},
748 caption left=Caption left,
749 caption left style={font=\sffamily},
750 middle=\texttt{name=WCname},
751 name=WCname,
752 start half,
753 title=Title,
754 title style={font=\bfseries},
755 title left=Title left,
756 title left style={font=\em}
757 ]{
758 1/Goldenrod/Text\\with\\multiple\\lines,
759 1/Mahogany/Text which is longer than the short text,
760 1/JungleGreen/Another text,
761 1/RoyalBlue/Short text
762 }
763 \draw[dashed] (WCname.south west) rectangle (WCname.north east);
764 \foreach\pos in {north,east,south,west}{
765 \node at (WCname.\pos) {\pos};
766 }
767 \end{tikzpicture}
768 \end{codeexample}
769 \end{stylekey}
770 \begin{stylekey}{/wheelchart/contour=\marg{options} (initially \normalfont empty)}
771 If this key is set then a contour with the style determined by this key will be drawn around the wheelchart. This requires a fixed inner and outer radius for all slices. This key does \emph{not} apply if a plot is used.
772 \end{stylekey}
773 \begin{key}{/wheelchart/counterclockwise=\opt{\meta{boolean}} (default true, initially false)}
774 If true, the wheelchart will be drawn counterclockwise instead of clockwise.
775 \end{key}
776 \begin{key}{/wheelchart/data=\marg{text} (initially \textbackslash WCvarC)}
777 This key contains the \meta{text} which will be placed at each slice of the wheelchart. This can be suppressed by using |data=|. The \meta{text} is placed in a node. The style of this node is given as follows. First, the anchor is set following Table \ref{tableanchorofthekeydatainthecasethatlinesextequaltozero} and Table \ref{tableanchorofthekeydatainthecasethatlinesextdifferentfromzero}. Then the option |align=left| is added. Thereafter, the style of the key |data style| is added.
778 \end{key}
779 \begin{key}{/wheelchart/data angle pos=\marg{value} (initially 0.5)}
780 \end{key}
781 \begin{key}{/wheelchart/data angle shift=\marg{angle} (initially 0)}
782 \end{key}
783 \begin{key}{/wheelchart/data pos=\marg{value} (initially 1)}
784 \end{key}
785 \begin{key}{/wheelchart/data sep=\marg{value} (initially 0.2)}
786 If no plot is used then the position of the contents of the key |data| is determined as described for the commands |\WCangle| and |\WCradius|.
787
788 If a plot is used then the position of the contents of the key |data| is determined as follows.
789 \begin{enumerate}
790 \item The inner plot is evaluated in the point with as angle the convex combination with as parameter the key |data angle pos| of the inner start angle and the inner end angle, added with the key |data angle shift| in degrees (taking into account the key |counterclockwise|) and as radius the inner radius minus the key |data sep|.
791 \item The outer plot is evaluated in the similar point but using the outer start angle, the outer end angle and the outer radius plus the key |data sep|.
792 \item If $\text{|lines|}\neq 0$ then the values of the keys |lines sep| and |lines| are added to the radii above, in addition to the key |data sep|.
793 \item The contents of the key |data| is placed at the convex combination with as parameter the key |data pos| of the previous two points.
794 \end{enumerate}
795 \begin{codeexample}[]
796 \begin{tikzpicture}
797 \wheelchart[
798 data angle pos{2}=0.3,
799 data angle pos{6}=0.8,
800 data angle shift{3}=-0.1,
801 data angle shift{5}=0.1,
802 data pos=\WClistB,
803 data sep=0,
804 lines{1,2,4,6,7}=0.5,
805 lines{3,5}=1,
806 lines angle pos{1}=0.8,
807 lines angle shift{7}=-0.2,
808 lines ext=\WClistA,
809 lines ext dir{1,...,3}=left,
810 lines ext dir{4,...,7}=right,
811 lines ext fixed,
812 lines ext fixed left=-1,
813 lines ext fixed right=7,
814 lines pos=\WClistB,
815 lines sep=0.2*\WClistA,
816 xbar={6}{1.5},
817 WClistA={1,0},
818 WClistB={0,1},
819 wheel data=\WCperc,
820 wheel data pos=0.5,
821 wheel data pos{1}=1,
822 wheel data pos{4}=0,
823 wheel data sep=0.2
824 ]{\exampleforthismanual}
825 \end{tikzpicture}
826 \end{codeexample}
827 \end{key}
828 \begin{stylekey}{/wheelchart/data style=\marg{options} (initially \normalfont empty)}
829 This key accepts a list of keys which will be applied to the node where the contents of the key |data| is placed.
830 \end{stylekey}
831 \begin{key}{/wheelchart/discrete=\opt{\meta{boolean}} (default true, initially false)}
832 If true then \tikzname{} pics are placed with the \meta{code} determined by the key |discrete pic|. The number of pics is determined by the key |value|. It is required to set the key |discrete space at borders|.
833 \end{key}
834 \begin{key}{/wheelchart/discrete factor=\marg{value} (initially 1)}
835 The algorithm to place the \tikzname{} pics depends on the \meta{value}. The value |1| is recommended.
836 \end{key}
837 \begin{key}{/wheelchart/discrete partitioning=\mchoice{angle,radius} (initially radius)}
838 \begin{description}
839 \item[\texttt{angle}] In this case, the \tikzname{} pics are placed uniformly with respect to the angle.
840 \item[\texttt{radius}] In this case, the \tikzname{} pics are placed uniformly with respect to the radius.
841 \end{description}
842 These options are illustrated in the examples below.
843 \begin{codeexample}[]
844 \begin{tikzpicture}
845 \pgfkeys{
846 /wheelchart,
847 discrete,
848 discrete pic={\fill (0,0) circle[radius=3pt];},
849 discrete space at borders=false,
850 middle style={font=\ttfamily},
851 start angle=180,
852 total angle=180,
853 value=\WCvarA/2
854 }
855 \foreach\angle in {0,...,27}{
856 \draw ({180*(\angle/27)}:2)--({180*(\angle/27)}:3);
857 }
858 \wheelchart[
859 discrete partitioning=angle,
860 middle={discrete\\partitioning=angle}
861 ]{\exampleforthismanual}
862 \draw[->] (\WCcoordinate[6]{16})--++(5:2) node[right] {point 16 of slice 6};
863 \foreach\radius in {0,...,3}{
864 \draw (2+\radius/3,-5) arc[start angle=0,end angle=180,radius=2+\radius/3];
865 }
866 \wheelchart[
867 at={(0,-5)},
868 middle={discrete\\partitioning=radius}
869 ]{\exampleforthismanual}
870 \draw[->] (\WCcoordinate[7]{21})--++(5:2) node[right] {point 21 of slice 7};
871 \end{tikzpicture}
872 \end{codeexample}
873 \end{key}
874 \begin{key}{/wheelchart/discrete pic=\marg{code} (initially \normalfont empty)}
875 The \meta{code} determines the \tikzname{} pics.
876 \begin{codeexample}[width=10cm]
877 \begin{tikzpicture}[yscale=-1]
878 \wheelchart[
879 data=,
880 discrete,
881 discrete pic={
882 \fill[draw=black] (-0.3,-0.3)
883 rectangle +(0.6,0.6);
884 \node[black] at (0,0)
885 {\WCcountdiscrete};
886 },
887 discrete space at borders,
888 value=\WCvarA/2,
889 ybar={8}{8}
890 ]{\exampleforthismanual}
891 \end{tikzpicture}
892 \end{codeexample}
893 \end{key}
894 \begin{key}{/wheelchart/discrete sort=\mchoice{angle,radius} (initially angle)}
895 \begin{description}
896 \item[\texttt{angle}] In this case, the \tikzname{} pics are ordered with respect to the angle.
897 \item[\texttt{radius}] In this case, the \tikzname{} pics are ordered with respect to the radius.
898 \end{description}
899 These options are illustrated in the examples below.
900 \begin{codeexample}[]
901 \begin{tikzpicture}
902 \pgfkeys{
903 /wheelchart,
904 data=,
905 discrete,
906 discrete pic={\shade[ball color=\WCvarB] (0,0) circle[radius=4pt];},
907 discrete space at borders=false,
908 middle style={font=\ttfamily},
909 start angle=180,
910 total angle=180,
911 value=\WCvarA/2
912 }
913 \wheelchart[
914 legend columns=4,
915 legend row={\tikz\shade[ball color=\WCvarB] (0,0) circle[radius=4pt]; & \WCvarC & \WCperc},
916 legend={\node[below] at (3.5,-1) {\begin{tabular}{*{4}{l@{ }lr}}\WClegend\end{tabular}};},
917 middle={discrete sort=angle}
918 ]{\exampleforthismanual}
919 \wheelchart[
920 at={(7,0)},
921 discrete sort=radius,
922 middle={discrete sort=radius}
923 ]{\exampleforthismanual}
924 \end{tikzpicture}
925 \end{codeexample}
926 \end{key}
927 \begin{key}{/wheelchart/discrete space at borders=\opt{\meta{boolean}} (default true)}
928 This key determines whether space is left at the begin and end where the \tikzname{} pics are placed. For example, suppose that $3$ \tikzname{} pics are placed at positions between $0$ and $1$. If |discrete space at borders| is true then these are placed at the positions $\frac{1}{6}$, $\frac{3}{6}$ and $\frac{5}{6}$. If |discrete space at borders| is false then these are placed at the positions $0$, $\frac{1}{2}$ and $1$.
929
930 This key deliberately has no initial value in order to force awareness of the consequences of the settings of this key. In the example below, the cyan \tikzname{} pics are aligned if |discrete space at borders| is false while this is \emph{not} the case if |discrete space at borders| is true.
931 \begin{codeexample}[]
932 \begin{tikzpicture}
933 \pgfkeys{
934 /wheelchart,
935 discrete,
936 discrete pic={\fill (0,0) circle[radius=4pt];},
937 middle style={font=\ttfamily},
938 start angle=180,
939 total angle=180
940 }
941 \draw[Red,ultra thick] (-3,0.15)--+(6,0);
942 \wheelchart[
943 discrete space at borders,
944 middle={discrete space at borders=true}
945 ]{2/Cyan/,20/Gray/,2/Cyan/}
946 \draw[Green,ultra thick] (4,0)--+(6,0);
947 \wheelchart[
948 at={(7,0)},
949 discrete space at borders=false,
950 middle={discrete space\\at borders=false}
951 ]{2/Cyan/,20/Gray/,2/Cyan/}
952 \end{tikzpicture}
953 \end{codeexample}
954 In the example below, the red and green \tikzname{} pics overlap if |discrete space at borders| is false while this is \emph{not} the case if |discrete space at borders| is true.
955 \begin{codeexample}[]
956 \begin{tikzpicture}
957 \pgfkeys{
958 /wheelchart,
959 discrete,
960 discrete pic={\fill (0,0) circle[radius=\WClistradius pt];},
961 middle style={font=\ttfamily}
962 }
963 \wheelchart[
964 discrete space at borders,
965 middle={discrete space\\at borders=true},
966 WClistradius=4
967 ]{2/Red/,40/Gray/,2/Green/}
968 \wheelchart[
969 at={(7,0)},
970 discrete space at borders=false,
971 middle={discrete space\\at borders=false},
972 WClistradius={8,4,4}
973 ]{2/Red/,40/Gray/,2/Green/}
974 \end{tikzpicture}
975 \end{codeexample}
976 \end{key}
977 \begin{key}{/wheelchart/domain=\marg{start}:\marg{end}}
978 This key sets |counterclockwise|, |start angle| to \meta{start} and |total angle| to $\text{\meta{end}}-\text{\meta{start}}$.
979 \end{key}
980 \begin{key}{/wheelchart/etoc code=\marg{code} (initially \textbackslash tableofcontents)}
981 The \meta{code} will be executed to build the \meta{wheelchart data} if the key |etoc level| is used.
982 \end{key}
983 \begin{key}{/wheelchart/etoc count total pages=\marg{number} (initially 0)}
984 If the key |etoc level| is used then the number of pages of the last section depends on \meta{number} which can for example represent the total number of pages in the document or the number of pages before the start of the Appendix or the Index. For example, |etoc count total pages=\totalpages| can be used. To provide the command |\totalpages|, this requires |\usepackage[page]{totalcount}|, which should normally be loaded \emph{before} the package |wheelchart| to give a correct result.
985 \end{key}
986 \begin{key}{/wheelchart/etoc level=\marg{level}}
987 If this key is used then the \meta{wheelchart data} of the command |\wheelchart| can be left empty and is defined to match the sections of the level defined by \meta{level}. Here, |\WCetocthelinkedname| corresponds to |\etocthelinkedname|, |\WCetocthelinkednumber| to |\etocthelinkednumber|, |\WCetocthelinkedpage| to |\etocthelinkedpage|, |\WCetocthename| to |\etocthename|, |\WCetocthenumber| to |\etocthenumber| and |\WCetocthepage| to |\etocthepage|. The package |etoc| is required to provide these commands. Furthermore, |\WCetocthenumberofpages| corresponds to the number of pages of the current section. For the last section, this depends on the value of the key |etoc count total pages|.
988 \end{key}
989 \begin{key}{/wheelchart/etoc name=\marg{name} (initially \normalfont empty)}
990 The resulting \meta{wheelchart data} from the key |etoc level| is stored globally and can be reused later with the key |etoc use name|.
991 \end{key}
992 \begin{key}{/wheelchart/etoc use name=\marg{name}}
993 If this key is used then the \meta{wheelchart data} is reused from where |etoc name| has the same \meta{name}.
994 \end{key}
995 \begin{key}{/wheelchart/expand list=\mchoice{false,once,true} (initially once)}
996 \begin{description}
997 \item[\texttt{false}] In this case, the \meta{wheelchart data} of the command |\wheelchart| will not be expanded.
998 \item[\texttt{once}] In this case, the \meta{wheelchart data} of the command |\wheelchart| will be expanded once.
999 \item[\texttt{true}] In this case, the \meta{wheelchart data} of the command |\wheelchart| will be fully expanded.
1000 \end{description}
1001 The following example illustrates the difference between the possible values of the key |expand list|.
1002 \begin{codeexample}[width=10cm]
1003 \begin{tikzpicture}
1004 \def\WClistA{a,A}
1005 \def\WClistB{b,B}
1006 \def\WCdata{\WClistA,\WClistB}
1007 \foreach\expandlist [count=\n] in
1008 {false,once,true}{
1009 \wheelchart[
1010 at={(3.5*\n,0)},
1011 data=\WCvarA,
1012 expand list=\expandlist,
1013 radius={0}{1},
1014 slices style{list}={
1015 Dandelion,CarnationPink,
1016 SpringGreen,ProcessBlue
1017 },
1018 title={expand list=\\\expandlist},
1019 title style={font=\ttfamily},
1020 value=1
1021 ]{\WCdata}
1022 }
1023 \end{tikzpicture}
1024 \end{codeexample}
1025 The initial setting |expand list=once| works in most situations, even when commands such as |\ref|, |\cite| and |\textbf| are used such as in the example below.
1026 \begin{codeexample}[width=10cm]
1027 \begin{tikzpicture}
1028 \wheelchart[
1029 % expand list=false,%false also works
1030 % expand list=true,%true doesn't work
1031 middle={
1032 expand list=\\
1033 false {\normalfont or} once
1034 },
1035 middle style={font=\large\ttfamily}
1036 ]{
1037 1/Emerald/Section \ref{Keys},
1038 1/Sepia/Reference \cite{TtTaPGFp},
1039 1/YellowOrange/$e^{i\pi}=-1$,
1040 1/Salmon/\textbf{Text}
1041 }
1042 \end{tikzpicture}
1043 \end{codeexample}
1044 In the following example, the \meta{wheelchart data} from the previous example is stored in a macro. In this case, we have to use the initial setting |expand list=once|.
1045 \begin{codeexample}[width=10cm]
1046 \begin{tikzpicture}
1047 \def\WClist{
1048 1/Emerald/Section \ref{Keys},
1049 1/Sepia/Reference \cite{TtTaPGFp},
1050 1/YellowOrange/$e^{i\pi}=-1$,
1051 1/Salmon/\textbf{Text}
1052 }
1053 \wheelchart[
1054 % expand list=false,
1055 % expand list=true,
1056 % false and true do not work
1057 middle={expand list=once},
1058 middle style={font=\large\ttfamily}
1059 ]{\WClist}
1060 \end{tikzpicture}
1061 \end{codeexample}
1062 In the example below, we have to use |expand list=true|.
1063 \begin{codeexample}[width=10cm]
1064 \begin{tikzpicture}
1065 \def\WCcolorsA{Yellow,Red}
1066 \def\WCcolorsB{Green,Blue}
1067 \wheelchart[
1068 data=,
1069 expand list=true,%false and once
1070 %do not work
1071 middle={expand list=true},
1072 middle style={font=\large\ttfamily},
1073 slices style=\WCvarA,
1074 value=1
1075 ]{\WCcolorsA,\WCcolorsB}
1076 \end{tikzpicture}
1077 \end{codeexample}
1078 In the example below, we have to use |expand list=true| and the command |\expandonce| from the package |etoolbox|.
1079 \begin{codeexample}[width=10cm,preamble={\usepackage{etoolbox}}]
1080 \begin{tikzpicture}
1081 \def\WCsliceA{1/Brown/\emph{A}: $\mu$}
1082 \def\WCsliceAfinal{\expandonce\WCsliceA}
1083 \def\WCsliceB{2/Tan/\textbf{B}: $\pi$}
1084 \def\WCsliceBfinal{\expandonce\WCsliceB}
1085 \wheelchart[
1086 expand list=true,%false and once
1087 %do not work
1088 middle={expand list=true},
1089 middle style={font=\large\ttfamily}
1090 ]{\WCsliceAfinal,\WCsliceBfinal}
1091 %\WCsliceA and \WCsliceB do not work
1092 \end{tikzpicture}
1093 \end{codeexample}
1094 \end{key}
1095 \begin{key}{/wheelchart/expand list items=\mchoice{false,once,true} (initially false)}
1096 This key is similar to the key |expand list| but applies to the items in the \meta{wheelchart data} of the command |\wheelchart| which correspond to a slice of the wheelchart.
1097 \begin{codeexample}[width=10cm]
1098 \def\WClistA{a/b}%
1099 \def\WClistB{c/d}%
1100 \def\WCdata{\WClistA/\WClistB}%
1101 \texttt{expand list items}%
1102 \foreach\expandlistitems in
1103 {false,once,true}{%
1104 \wheelchart[
1105 expand list=false,
1106 expand list items=\expandlistitems,
1107 legend=; \texttt{\expandlistitems}:
1108 \WCvarA,
1109 legend only,
1110 value=1
1111 ]{\WCdata}%
1112 }
1113 \end{codeexample}
1114 \end{key}
1115 \begin{key}{/wheelchart/explode=\marg{value} (default 0.2, initially 0)}
1116 This key will shift the slices of the wheelchart with \meta{value} with respect to the center of the wheelchart.
1117 \end{key}
1118 \begin{key}{/wheelchart/for loop end=\marg{code} (initially \normalfont empty)}
1119 The slices of the wheelchart, the wheel lines determined by the key |wheel lines| and the different kinds of data are placed in for loops. If the key |for loop end| is set then the \meta{code} given to this key will be executed at the end of the body of these for loops.
1120 \end{key}
1121 \begin{key}{/wheelchart/for loop start=\marg{code} (initially \normalfont empty)}
1122 This key is similar to the key |for loop end| but the \meta{code} given to this key will be executed at the start of the body of the for loops.
1123 \end{key}
1124 \begin{key}{/wheelchart/gap=\marg{value} (default 0.05, initially 0)}
1125 The \meta{value} of this key defines half the distance between two slices of the wheelchart. This key does \emph{not} apply if a plot is used.
1126 \end{key}
1127 \begin{key}{/wheelchart/gap max angle=\marg{angle} (initially 180)}
1128 If the value of the key |gap| is too large then a slice can partly disappear such as for example below when |gap max angle| is \ang{155}. The \meta{angle} of the key |gap max angle| determines the inner arc of the slice as illustrated in the examples below.
1129 \begin{codeexample}[preamble={\usepackage{siunitx}}]
1130 \begin{tikzpicture}
1131 \foreach\gapmaxangle [count=\n] in {90,120,155}{
1132 \begin{scope}[shift={(5*\n,0)}]
1133 \wheelchart[
1134 gap=1,
1135 gap max angle=\gapmaxangle,
1136 radius={0}{2},
1137 total angle=315
1138 ]{1/CornflowerBlue!50/}
1139 \fill (0,0) circle[radius=2pt];
1140 \draw (0,0) circle[radius=2];
1141 \draw (135:2)--(0:0)--(90:2);
1142 \draw (0:0)--(135+\gapmaxangle:{1/sin(\gapmaxangle)}) arc[start angle=135+\gapmaxangle,
1143 end angle=450-\gapmaxangle,radius=1/sin(\gapmaxangle)]--cycle;
1144 \node at (45:0.6) {\ang{\gapmaxangle}};
1145 \node at (180:0.6) {\ang{\gapmaxangle}};
1146 \end{scope}
1147 }
1148 \end{tikzpicture}
1149 \end{codeexample}
1150 \end{key}
1151 \begin{key}{/wheelchart/gap polar=\marg{value} (default 1, initially 0)}
1152 The \meta{value} of this key defines half the polar gap in degrees between two slices of the wheelchart.
1153
1154 Note the difference between the keys |explode|, |gap| and |gap polar|. This is illustrated in the examples below.
1155 \begin{codeexample}[width=10cm]
1156 \begin{tikzpicture}
1157 \wheelchart[
1158 explode=1,
1159 middle=\Large\texttt{explode},
1160 radius={1}{2},
1161 slices style={
1162 draw=Red,
1163 fill=none,
1164 ultra thick
1165 },
1166 total count=6
1167 ]{}
1168 \draw (0,0) circle[radius=2]
1169 circle[radius=3];
1170 \end{tikzpicture}
1171 \end{codeexample}
1172 \begin{codeexample}[width=10cm]
1173 \begin{tikzpicture}
1174 \wheelchart[
1175 gap=0.5,
1176 legend entry=
1177 \draw (\WCcoordinate{outer end})
1178 --(\WCcoordinate[\WCcount -2]
1179 {outer start});
1180 \draw[<->] (\WCpoint{1}{0}{0.5}{0})
1181 --(\WCpoint[\WCcount +1]
1182 {0}{0}{0.5}{0});,
1183 middle=\Large\texttt{gap},
1184 slices style={
1185 draw=Red,
1186 fill=none,
1187 ultra thick
1188 },
1189 total count=6
1190 ]{}
1191 \draw (0,0) circle[radius=2]
1192 circle[radius=3];
1193 \end{tikzpicture}
1194 \end{codeexample}
1195 \begin{codeexample}[width=10cm]
1196 \begin{tikzpicture}
1197 \wheelchart[
1198 gap polar=10,
1199 legend entry{1,2,3}=
1200 \draw (\WCcoordinate{outer start})
1201 --(\WCcoordinate[\WCcount +3]
1202 {outer start});
1203 \draw (\WCcoordinate{outer end})
1204 --(\WCcoordinate[\WCcount +3]
1205 {outer end});,
1206 middle=\Large\texttt{gap polar},
1207 slices style={
1208 draw=Red,
1209 fill=none,
1210 ultra thick
1211 },
1212 total count=6
1213 ]{}
1214 \draw (0,0) circle[radius=2]
1215 circle[radius=3];
1216 \end{tikzpicture}
1217 \end{codeexample}
1218 \end{key}
1219 \begin{key}{/wheelchart/gap radius=\marg{value} (default 0.05, initially 0)}
1220 The \meta{value} of this key will be added to |inner radius| and substracted from |outer radius|.
1221 \begin{codeexample}[width=10cm,preamble={\usepackage{siunitx}}]
1222 \begin{tikzpicture}
1223 \def\n{73}
1224 \wheelchart[
1225 data=,
1226 gap radius=\WCvarC,
1227 middle=\Huge\qty{\n}{\percent}
1228 ]{
1229 \n/NavyBlue/0,
1230 100-\n/BurntOrange/0.2
1231 }
1232 \draw[Gray] (0,0) circle[radius=1.9];
1233 \end{tikzpicture}
1234 \end{codeexample}
1235 \end{key}
1236 \begin{key}{/wheelchart/header=\marg{list}}
1237 The items in the \meta{list} determine the names in the macros |\|\meta{prefix}\meta{name}.
1238 \end{key}
1239 \begin{key}{/wheelchart/header prefix=\marg{prefix} (initially WC)}
1240 The \meta{prefix} is used in the macros |\|\meta{prefix}\meta{name}.
1241 \end{key}
1242 \begin{key}{/wheelchart/inner data=\marg{text} (initially \normalfont empty)}
1243 This key contains the \meta{text} which will be placed at each slice of the wheelchart. The \meta{text} is placed in a node. The style of this node is given as follows. First, the option |align=left| is given. Thereafter, the style of the key |inner data style| is added.
1244 \end{key}
1245 \begin{key}{/wheelchart/inner data angle pos=\marg{value} (initially 0.5)}
1246 \end{key}
1247 \begin{key}{/wheelchart/inner data angle shift=\marg{angle} (initially 0)}
1248 \end{key}
1249 \begin{key}{/wheelchart/inner data pos=\marg{value} (initially 0)}
1250 \end{key}
1251 \begin{key}{/wheelchart/inner data sep=\marg{value} (initially 0.2)}
1252 These keys determine the position of the contents of the key |inner data| similar as the corresponding keys for the key |data|. No lines are drawn for the inner data.
1253 \end{key}
1254 \begin{stylekey}{/wheelchart/inner data style=\marg{options} (initially \normalfont empty)}
1255 This key accepts a list of keys which will be applied to the node where the contents of the key |inner data| is placed.
1256 \end{stylekey}
1257 \begin{key}{/wheelchart/inner plot=\marg{code}}
1258 The \meta{code} is a coordinate definition which will be used for the inner parts of the slices of the wheelchart. In the \meta{code}, |#1| and |#2| can be used where |#1| corresponds to the angle and |#2| corresponds to the radius. For example, a circle can be obtained with |inner plot={{#1}:{#2}}|.
1259 \end{key}
1260 \begin{stylekey}{/wheelchart/inner plot style=\marg{options} (initially \normalfont empty)}
1261 This key accepts a list of keys which will be applied to the plot determined by the key |inner plot|.
1262 \end{stylekey}
1263 \begin{key}{/wheelchart/inner radius=\marg{value} (initially 2)}
1264 The \meta{value} of this key defines the inner radius of the wheelchart.
1265 \end{key}
1266 \begin{key}{/wheelchart/legend=\marg{code} (initially \normalfont empty)}
1267 The \meta{code} given to this key will be executed at the end of the command |\wheelchart|.
1268 \end{key}
1269 \begin{key}{/wheelchart/legend columns=\marg{number} (initially 1)}
1270 If the key |legend row| is used then the maximum number of times that the \meta{code} given to the key |legend row| appears on one row is determined by \meta{number}. The environment (for example |tabular|, |tabularx| from the package |tabularx|, |tabulary| from the package |tabulary| or |tblr| from the package |tabularray|) which contains the macro |\WClegend| needs to have a suitable column specification according with \meta{number} and the key |legend row|.
1271 \end{key}
1272 \begin{key}{/wheelchart/legend entry=\marg{code} (initially \normalfont empty)}
1273 The \meta{code} given to this key will be executed for each slice of the wheelchart.
1274 \end{key}
1275 \begin{key}{/wheelchart/legend only=\opt{\meta{boolean}} (default true, initially false)}
1276 If true then only the legend is constructed. This does \emph{not} apply to the key |legend entry|.
1277
1278 In this case it is \emph{not} necessary to place the command |\wheelchart| in a |tikzpicture| environment.
1279 \begin{codeexample}[width=10cm,preamble={\usepackage{tikzlings}}]
1280 \wheelchart[
1281 header={animal,accessory},
1282 legend columns=3,
1283 legend only,
1284 legend row={\tikz[scale=0.3]{
1285 \csname \WCanimal\endcsname[
1286 signpost=\WCcount,
1287 \WCaccessory
1288 ]} & \WCanimal},
1289 legend=
1290 \begin{tabular}{*{3}{cl}}
1291 \multicolumn{6}{c}{
1292 \WCtotalcount{} animals
1293 from the package
1294 \texttt{tikzlings}}\\\hline
1295 \WClegend\hline
1296 \end{tabular},
1297 separator columns={{ }},
1298 separator rows=;,
1299 value=1
1300 ]{
1301 bear basket;
1302 bee book;
1303 bug chef;
1304 cat crown;
1305 elephant football;
1306 koala handbag;
1307 owl hat;
1308 panda icecream;
1309 penguin milkshake;
1310 snowman santa;
1311 squirrel shovel
1312 }
1313 \end{codeexample}
1314 \end{key}
1315 \begin{key}{/wheelchart/legend row=\marg{code}}
1316 If this key is set then a legend consisting of rows for an environment such as |tabular|, |tabularx| from the package |tabularx|, |tabulary| from the package |tabulary| or |tblr| from the package |tabularray| is constructed using the \meta{code} for each slice of the wheelchart.
1317
1318 If a |tblr| environment from the package |tabularray| is used then |\UseTblrLibrary{counter}| is required.
1319
1320 The maximum number of times that the \meta{code} appears on one row is determined by the key |legend columns|.
1321
1322 The code automatically inserts |&| and |\\| after the \meta{code} if necessary.
1323
1324 The result is stored in the macro |\WClegend|.
1325 \begin{codeexample}[preamble={\usepackage{tabularray}
1326 \UseTblrLibrary{counter,siunitx}}]
1327 \begin{tikzpicture}
1328 \wheelchart[
1329 after slices={
1330 \pgfdeclareradialshading{WCshading}{\pgfpoint{0cm}{0cm}}{
1331 color(0bp)=(\WCvarB);
1332 color(16.66666bp)=(\WCvarB);%2/3 * 25bp
1333 color(20.83333bp)=(\WCvarB!10);%2.5/3 * 25bp
1334 color(25bp)=(\WCvarB);
1335 color(50bp)=(\WCvarB)
1336 }
1337 \shade[even odd rule,shading=WCshading] (0,0) circle[radius=3] circle[radius=2];
1338 },
1339 data=,
1340 legend row={\tikz\fill[\WCvarB] (0,0) rectangle (0.3,0.3);
1341 & \WCvarC & \WCvarA & \WCpercentagerounded & \WCvarD},
1342 legend={
1343 \node[right] at (3.5,0) {
1344 \begin{tblr}{
1345 colspec={llS[table-format=3.0]S[table-format=2.0{\,\unit{\percent}}]l},
1346 column{1}={rightsep=0pt,appto=\ },
1347 column{2}={leftsep=0pt},
1348 cell{2-Y}{4}={appto=\,\unit{\percent}},
1349 row{1}=guard
1350 }
1351 & Fruit & Value & Percentage & Vitamins\\\hline
1352 \WClegend\hline
1353 & \textbf{Total} & \WCtotalnum & & \\
1354 \end{tblr}
1355 };
1356 },
1357 slices style={
1358 fill=none,
1359 clip
1360 }
1361 ]{\exampleforthismanual}
1362 \end{tikzpicture}
1363 \end{codeexample}
1364 \end{key}
1365 \begin{key}{/wheelchart/lines=\marg{value} (default 1, initially 0)}
1366 The \meta{value} is used in the positioning of the contents of the key |data|. The end point of the lines is determined similarly but without the key |data sep|.
1367 \begin{codeexample}[width=10cm,preamble={\usepackage{siunitx}}]
1368 \begin{tikzpicture}
1369 \def\WCtest#1#2{
1370 \pgfmathparse{
1371 \WCpercentage>10?"#1":"#2"
1372 }
1373 \pgfmathresult
1374 }
1375 \wheelchart[
1376 data=\WCtest{}{\WCperc},
1377 lines=\WCpercentage>10?0:0.5,
1378 lines style={dotted,thick},
1379 pie,
1380 slices style={
1381 bottom color=\WCvarB,
1382 top color=\WCvarB!80!black,
1383 shading angle=\WCmidangle-90
1384 },
1385 wheel data=\WCtest{\WCperc}{}
1386 ]{\exampleforthismanual}
1387 \end{tikzpicture}
1388 \end{codeexample}
1389 \end{key}
1390 \begin{key}{/wheelchart/lines angle pos=\marg{value} (initially 0.5)}
1391 \end{key}
1392 \begin{key}{/wheelchart/lines angle shift=\marg{angle} (initially 0)}
1393 These keys are similar to the corresponding keys for |data| but determine the start point of the lines.
1394 \end{key}
1395 \begin{key}{/wheelchart/lines ext=\marg{value} (default 0.5, initially 0)}
1396 If the \meta{value} of this key is nonzero and |lines ext fixed| is false then the lines between the wheelchart and the contents of the key |data| will be extended horizontally with a length defined by \meta{value}.
1397 \end{key}
1398 \begin{key}{/wheelchart/lines ext bottom dir=\mchoice{left,right} (initially right)}
1399 \end{key}
1400 \begin{key}{/wheelchart/lines ext dir=\mchoice{left,right}}
1401 The default direction in which the lines between the wheelchart and the contents of the key |data| will be extended horizontally if $\text{|lines ext|}\neq 0$ is determined by Table \ref{tablelinesextdir} and illustrated in the following example. This can be overruled by giving an explicit value to this key. Note that rounding errors can occur in the computation of the angle which is used to determine the default direction according to Table \ref{tablelinesextdir}.
1402 \begin{table}[ht]
1403 \centering
1404 \begin{tabular}{ll}
1405 & The direction in which the lines between the\\
1406 & wheelchart and the contents of the key |data| will\\
1407 & be extended horizontally if $\text{|lines ext|}\neq 0$ and\\
1408 Angle (up to rounding errors) & if the key |lines ext dir| is not used\\\hline
1409 $\rinterval{0}{90-\text{|lines ext dirsep|}}$ & right\\
1410 $[90-\text{|lines ext dirsep|},90+\text{|lines ext dirsep|}]$ & value of the key |lines ext top dir|\\
1411 $\ointerval{90+\text{|lines ext dirsep|}}{270-\text{|lines ext dirsep|}}$ & left\\
1412 $[270-\text{|lines ext dirsep|},270+\text{|lines ext dirsep|}]$ & value of the key |lines ext bottom dir|\\
1413 $\ointerval{270+\text{|lines ext dirsep|}}{360}$ & right\\
1414 \end{tabular}
1415 \caption{The direction in which the lines between the wheelchart and the contents of the key \texttt{data} will be extended horizontally if $\text{\ttfamily lines ext}\neq 0$ and if the key \texttt{lines ext dir} is not used.}\label{tablelinesextdir}
1416 \end{table}
1417 \begin{codeexample}[width=10cm,preamble={\usetikzlibrary{patterns}}]
1418 \begin{tikzpicture}[font=\ttfamily]
1419 \def\WClinesextdirsep{10}
1420 \wheelchart[
1421 data{1,6}=lines ext top dir,
1422 data{2}=right,
1423 data{3,4}=lines ext bottom dir,
1424 data{5}=left,
1425 data angle pos=\WClistdap,
1426 data sep=0,
1427 inner data angle pos{1,4}=0.1,
1428 inner data angle pos{3,6}=0.9,
1429 inner data pos=1,
1430 inner data sep=0.4,
1431 inner data style=\WClistia,
1432 lines=0.6,
1433 lines{1,3}=0.2,
1434 lines angle pos=\WClistdap,
1435 lines ext,
1436 lines ext dirsep=\WClinesextdirsep,
1437 lines sep{list}={0.7,0.2,0.7},
1438 lines style=->,
1439 slice{1,3,4,6}={
1440 arc=<->,
1441 inner data=lines ext dirsep,
1442 value=\WClinesextdirsep
1443 },
1444 slices style={
1445 draw,
1446 pattern=\WClistpattern
1447 },
1448 total count=6,
1449 value{2,5}=180-2*\WClinesextdirsep,
1450 WClistdap={0.9,0.2,0.1},
1451 WClistia={right,left},
1452 WClistpattern={
1453 crosshatch,dots,crosshatch
1454 }
1455 ]{}
1456 \end{tikzpicture}
1457 \end{codeexample}
1458 \end{key}
1459 \begin{key}{/wheelchart/lines ext dirsep=\marg{angle} (initially 0)}
1460 This key determines half the angle in degrees of the segment to which the keys |lines ext bottom dir| and |lines ext top dir| apply.
1461 \end{key}
1462 \begin{key}{/wheelchart/lines ext fixed=\opt{\meta{boolean}} (default true, initially false)}
1463 If true, the line between the wheelchart and the contents of the key |data| will be extended horizontally till the $x$ coordinate determined by the keys |lines ext fixed left| and |lines ext fixed right|.
1464 \end{key}
1465 \begin{key}{/wheelchart/lines ext fixed left=\marg{value}}
1466 \end{key}
1467 \begin{key}{/wheelchart/lines ext fixed right=\marg{value}}
1468 If |lines ext fixed| is true, the lines are extended horizontally initially to the right till the $x$ coordinate $\text{|outer radius|}+\text{|lines sep|}+\text{|lines|}+\text{|lines ext|}$ and to the left till the opposite of this $x$ coordinate. This can be overruled by giving an explicit value to the key |lines ext fixed left| and/or |lines ext fixed right|.
1469 \end{key}
1470 \begin{key}{/wheelchart/lines ext left anchor=\marg{anchor} (initially mid east)}
1471 \end{key}
1472 \begin{key}{/wheelchart/lines ext right anchor=\marg{anchor} (initially mid west)}
1473 \begin{table}[ht]
1474 \centering
1475 \begin{tabular}{ll}
1476 The direction in which the lines between the & \\
1477 wheelchart and the contents of the key |data| will & \\
1478 be extended horizontally if $\text{|lines ext|}\neq 0$ & Anchor of the key |data|\\\hline
1479 left & value of the key |lines ext left anchor|\\
1480 right & value of the key |lines ext right anchor|\\
1481 \end{tabular}
1482 \caption{Anchor of the key \texttt{data} in the case that $\text{\ttfamily lines ext}\neq 0$.}\label{tableanchorofthekeydatainthecasethatlinesextdifferentfromzero}
1483 \end{table}
1484 \end{key}
1485 \begin{key}{/wheelchart/lines ext top dir=\mchoice{left,right} (initially right)}
1486 \end{key}
1487 \begin{key}{/wheelchart/lines pos=\marg{value} (initially 1)}
1488 \end{key}
1489 \begin{key}{/wheelchart/lines sep=\marg{value} (initially 0.2)}
1490 These keys are similar to the corresponding keys for |data| but determine the start point of the lines.
1491 \end{key}
1492 \begin{stylekey}{/wheelchart/lines style=\marg{options} (initially \normalfont empty)}
1493 This key accepts a list of keys which will be applied to the lines drawn by the key |lines|.
1494 \begin{codeexample}[width=10cm,preamble={\usepackage{siunitx}
1495 \usetikzlibrary{decorations.markings}}]
1496 \begin{tikzpicture}
1497 \wheelchart[
1498 data=\WCperc,
1499 data angle pos{4}=0.2,
1500 % data style={outer xsep=4pt},
1501 legend columns=2,
1502 legend row={\tikz\fill[\WCvarB] (0,0) circle[radius=0.15]; & \WCvarC & $\WCvarA$},
1503 legend={
1504 \node[below,draw,rounded corners,thick] at (0,-4.5) {
1505 \begin{tabular}{*{2}{l@{ }lr}}
1506 \WClegend
1507 \end{tabular}
1508 };
1509 },
1510 lines=0.5,
1511 lines ext=1,
1512 lines ext bottom dir=left,
1513 lines ext dirsep=1,
1514 lines ext fixed,
1515 lines ext top dir=right,
1516 lines sep=0,
1517 lines style={
1518 \WCvarB,
1519 postaction=decorate,
1520 decoration={
1521 markings,
1522 mark=at position 1 with {\fill[\WCvarB] (0,0) circle[radius=0.15];}
1523 }
1524 },
1525 start angle=331.2
1526 ]{\exampleforthismanual}
1527 \wheelchart[
1528 data=,
1529 radius={1.5}{2},
1530 slices style=\WCvarB!70,
1531 start angle=331.2
1532 ]{\exampleforthismanual}
1533 \end{tikzpicture}
1534 \end{codeexample}
1535 \begin{codeexample}[width=10cm]
1536 \begin{tikzpicture}
1537 \wheelchart[
1538 data sep=0,
1539 data style={
1540 inner sep=0pt,
1541 shift={(0,0.1)}
1542 },
1543 lines=0.5,
1544 lines ext=1.2,
1545 lines ext bottom dir=right,
1546 lines ext dirsep=1,
1547 % lines ext fixed,
1548 lines ext left anchor=base west,
1549 lines ext right anchor=base east,
1550 lines ext top dir=left,
1551 lines pos=0.5,
1552 lines sep=0,
1553 % lines style=\WCvarB,
1554 start angle=331.2
1555 ]{\exampleforthismanual}
1556 \end{tikzpicture}
1557 \end{codeexample}
1558 \begin{codeexample}[width=10cm,preamble={\usetikzlibrary{decorations.markings}}]
1559 \begin{tikzpicture}
1560 \wheelchart[
1561 data=\WCvarC: \WCvarA,
1562 data angle shift=\WCvarG,
1563 data sep=0,
1564 data style={draw=\WCvarB,fill=\WCvarB!20},
1565 lines=1.5,
1566 lines ext=1,
1567 lines sep=-1,
1568 lines style={
1569 postaction=decorate,
1570 decoration={
1571 markings,
1572 mark=at position 0 with {\fill (0,0) circle[radius=0.15];}
1573 }
1574 },
1575 pie,
1576 start angle=331.2
1577 ]{\exampleforthismanual}
1578 \end{tikzpicture}
1579 \end{codeexample}
1580 \end{stylekey}
1581 \begin{key}{/wheelchart/middle=\marg{text} (initially \normalfont empty)}
1582 This key contains the \meta{text} which will be placed at the center of the wheelchart. The \meta{text} is placed in a node. The style of this node is given as follows. First, the option |align=center| is given. Thereafter, the style of the key |middle style| is added.
1583 \end{key}
1584 \begin{stylekey}{/wheelchart/middle fill=\marg{options} (initially \normalfont empty)}
1585 If this key is set then the middle of the wheelchart will be filled with this style. This requires a fixed inner and outer radius for all slices. This key does \emph{not} apply if a plot is used.
1586 \end{stylekey}
1587 \begin{stylekey}{/wheelchart/middle style=\marg{options} (initially \normalfont empty)}
1588 This key accepts a list of keys which will be applied to the node where the contents of the key |middle| is placed.
1589 \end{stylekey}
1590 \begin{key}{/wheelchart/name=\marg{name} (initially wheelchart@name)}
1591 This key defines the \meta{name} of the |local bounding box| around the wheelchart.
1592 \end{key}
1593 \begin{key}{/wheelchart/outer plot=\marg{code}}
1594 This key is similar to the key |inner plot| but determines the outer parts of the slices of the wheelchart.
1595 \begin{codeexample}[]
1596 \begin{tikzpicture}
1597 \wheelchart[
1598 inner plot={{#1}:{#2+0.2*(cos(#1*\WCtotalcount)+1)}},
1599 outer plot={{#1}:{#2+0.2*(cos(#1*\WCtotalcount*2)+1)}}
1600 ]{\exampleforthismanual}
1601 \end{tikzpicture}
1602 \end{codeexample}
1603 \catcode`|=12%
1604 \begin{codeexample}[preamble={\usetikzlibrary{decorations.text}}]
1605 \begin{tikzpicture}
1606 \wheelchart[
1607 arc data=slice \WCcount\\|\bfseries|\WCvarC,
1608 arc data expand=f,
1609 arc data pos=0.5,
1610 arc data line sep factor=1.5,
1611 data=,
1612 domain=0:450,
1613 inner plot={
1614 {int((#1)/180)*5+(0.5-((-1)^Mod(int((#1)/180),2))*2.5)*cos(#1)},
1615 {(2.5-((-1)^Mod(int((#1)/180),2))*0.5)*sin(#1)}
1616 },
1617 outer plot={
1618 {int((#1)/180)*5+(-0.5-((-1)^Mod(int((#1)/180),2))*2.5)*cos(#1)},
1619 {(2.5+((-1)^Mod(int((#1)/180),2))*0.5)*sin(#1)}
1620 },
1621 value=width("\WCvarC")
1622 ]{\exampleforthismanual}
1623 \end{tikzpicture}
1624 \end{codeexample}
1625 \catcode`|=13%
1626 \end{key}
1627 \begin{stylekey}{/wheelchart/outer plot style=\marg{options} (initially \normalfont empty)}
1628 This key accepts a list of keys which will be applied to the plot determined by the key |outer plot|.
1629 \end{stylekey}
1630 \begin{key}{/wheelchart/outer radius=\marg{value} (initially 3)}
1631 The \meta{value} of this key defines the outer radius of the wheelchart.
1632 \end{key}
1633 \begin{key}{/wheelchart/perc precision=\marg{number} (initially 0)}
1634 This key defines the number of decimals up to which the percentage in the macros |\WCperc| and |\WCpercentagerounded| is rounded. The rounding is performed with |l3fp|. With the initial setting, for example \num{49.5} and \num{50.5} are both rounded to 50. With |perc precision={0,1}|, \num{49.5} is rounded to 50 and \num{50.5} to 51.
1635 \end{key}
1636 \begin{key}{/wheelchart/pie=\opt{\meta{boolean}} (default true, initially false)}
1637 If true, the inner radius of the wheelchart is set to |0|.
1638 \end{key}
1639 \begin{key}{/wheelchart/plot=\marg{code}}
1640 This key sets |inner plot| and |outer plot|.
1641
1642 Since the \emph{let operation} from the \tikzname{} library |calc| is used, it is not possible to use the variable names |\n|, |\p|, |\x| and |\y| inside the \meta{code}.
1643
1644 Note that positions depend on the |domain| and \emph{not} on the length of the |plot|. For example below, |data angle pos=0.5|. The corresponding value of the |domain| is $1$ which gives the $x$ coordinate $1$ which is \emph{not} in the middle of the plot. Whereas |wheel data angle pos=sqrt(2)/2|. The corresponding value of the |domain| is $\sqrt{2}$ which gives the $x$ coordinate $2$ which is in the middle of the plot.
1645 \begin{codeexample}[width=10cm]
1646 \begin{tikzpicture}
1647 \wheelchart[
1648 domain=0:2,
1649 plot={{(#1)^2},{#2}},
1650 wheel data=text B,
1651 wheel data angle pos=sqrt(2)/2
1652 ]{1/BrickRed/text A}
1653 \end{tikzpicture}
1654 \end{codeexample}
1655 \begin{codeexample}[width=10cm]
1656 \begin{tikzpicture}
1657 \wheelchart[
1658 plot={{#1}:{0.5*(sin(#1*3)+1)+#2}}
1659 ]{\exampleforthismanual}
1660 \end{tikzpicture}
1661 \end{codeexample}
1662 \begin{codeexample}[]
1663 \begin{tikzpicture}
1664 \wheelchart[
1665 domain=0:720,
1666 gap polar=5,
1667 plot={{#1*3.5/180},{sin(#1)-#2}},
1668 radius={0}{2},
1669 value=1,
1670 wheel data=\WCcount,
1671 wheel data pos=0.5
1672 ]{\exampleforthismanual}
1673 \end{tikzpicture}
1674 \end{codeexample}
1675 \begin{codeexample}[width=10cm,preamble={\usetikzlibrary{decorations.text}}]
1676 \begin{tikzpicture}
1677 \wheelchart[
1678 arc data=\WCvarC,
1679 arc data dir=\WCmidangle<180?-1:1,
1680 arc data pos=0.5,
1681 data=,
1682 domain=0:900,
1683 plot={{#1}:
1684 {(((#1)*pi/180+15)^2-1)/300
1685 +(#2)-0.25}},
1686 radius={0}{0.5},
1687 slices arrow={1}{0},
1688 value=sqrt(3+\WCcount*pi*(pi+6)/7)-
1689 sqrt(3+(\WCcount-1)*pi*(pi+6)/7)
1690 ]{\exampleforthismanual}
1691 \end{tikzpicture}
1692 \end{codeexample}
1693 \begin{codeexample}[]
1694 \begin{tikzpicture}
1695 \pgfkeys{
1696 /wheelchart,
1697 gap,
1698 radius={1.3}{2},
1699 start angle=180*(1-2/\WCtotalcount),
1700 value=1
1701 }
1702 \wheelchart[
1703 plot={{#1}:{(#2)*cos(180/\WCtotalcount)/cos(Mod(#1,360/\WCtotalcount)-180/\WCtotalcount)}}
1704 ]{\exampleforthismanual}
1705 \wheelchart[
1706 at={(8,0)},
1707 slices inner arrow={-tan(180/\WCtotalcount)}{0},
1708 slices outer arrow={tan(180/\WCtotalcount)}{0}
1709 ]{\exampleforthismanual}
1710 \end{tikzpicture}
1711 \end{codeexample}
1712 \end{key}
1713 \begin{stylekey}{/wheelchart/plot style=\marg{options} (initially \normalfont empty)}
1714 This key sets |inner plot style| and |outer plot style|.
1715 \end{stylekey}
1716 \begin{key}{/wheelchart/radius=\marg{inner radius}\marg{outer radius}}
1717 This key defines the inner and outer radius of the wheelchart.
1718 \end{key}
1719 \begin{key}{/wheelchart/samples=\marg{number} (initially 25)}
1720 This key determines the \meta{number} of samples used in the plots.
1721 \end{key}
1722 \begin{key}{/wheelchart/separator columns=\marg{delimiter} (initially /)}
1723 \end{key}
1724 \begin{key}{/wheelchart/separator rows=\marg{delimiter} (initially ,)}
1725 The \meta{wheelchart data} in the command |\wheelchart| is a list in which the items are separated by the value of the key |separator rows|. Each item in this list corresponds to one slice of the wheelchart and consists of data separated by the value of the key |separator columns|.
1726 \end{key}
1727 \begin{key}{/wheelchart/slices=\marg{path}}
1728 If this key is set then the shape of the slices of the wheelchart is defined by \meta{path}.
1729 \begin{codeexample}[]
1730 \begin{tikzpicture}
1731 \def\r{2.5}
1732 %\draw[Red,ultra thick] (0,0) circle[radius=\r];%for comparison
1733 \wheelchart[
1734 data=,
1735 legend entry={
1736 \draw[->,\WCvarI] let
1737 \n1={\WCangle{0.5}{0}{1}{0}},
1738 \n2={\WCangle[\WCcount+1]{0.5}{0}{1}{0}-(\WCcount==\WCtotalcount?360:0)},
1739 \p1=(WCslice\WCcount.\n1),
1740 \p2=(WCslice\fpeval{\WCcount=\WCtotalcount?1:\WCcount+1}.\n2),
1741 \n3={\n1-2*asin(0.5*(veclen(\x1,\y1)/\r cm-1))}
1742 in (\n3:\r) arc[start angle=\n3,end angle={\n2+2*asin(0.5*(veclen(\x2,\y2)/\r cm-1))},radius=\r];
1743 },
1744 radius={0}{\r},
1745 slices={node[circle,draw,thick,fill=\WCvarB] (WCslice\WCcount) {\WCvarC};},
1746 slices pos=1,
1747 slices style=,
1748 start half,
1749 value=1
1750 ]{\exampleforthismanual}
1751 \end{tikzpicture}
1752 \end{codeexample}
1753 \end{key}
1754 \begin{key}{/wheelchart/slices angle pos=\marg{value} (initially 0.5)}
1755 \end{key}
1756 \begin{key}{/wheelchart/slices angle shift=\marg{angle} (initially 0)}
1757 These keys determine the position of the slices if the key |slices| is used similar as the corresponding keys for the key |data|.
1758 \end{key}
1759 Below we list some keys to modify the shape of the slices. These keys only affect the shape of the slices and \emph{not} the computation of the inner and outer sides. In particular, these keys do \emph{not} affect the placement of |arc|, |arc data|, |data|, |inner data|, |lines|, |wheel data| and |wheel lines|. If this placement should be changed then the keys |inner plot| and |outer plot| can be used.
1760 \begin{key}{/wheelchart/slices arc=\marg{value 1}\marg{value 2}}
1761 This key sets |slices end arc| and |slices start arc| but uses the opposite of \meta{value 1} for |slices start arc|.
1762 \begin{codeexample}[width=10cm]
1763 \begin{tikzpicture}
1764 \wheelchart[
1765 slices arc={1}{0},
1766 wheel data=\WCcount,
1767 wheel data angle pos=1,
1768 wheel data pos=0.5,
1769 wheel data style={
1770 circle,
1771 fill=\WCvarB!50
1772 }
1773 ]{\exampleforthismanual}
1774 \end{tikzpicture}
1775 \end{codeexample}
1776 \begin{codeexample}[width=10cm]
1777 \begin{tikzpicture}
1778 \wheelchart[
1779 data=,
1780 radius={1}{4.5},
1781 slices arc={1}{0.66},
1782 slices style=\WCvarA,
1783 start half,
1784 value=1,
1785 wheel data=
1786 \textbf{Number \WCcount}\\
1787 \WCvarB,
1788 wheel data pos=0.5,
1789 wheel data style=white
1790 ]{
1791 Yellow/Some text A,
1792 Orange/Some text B,
1793 Red/Some text C,
1794 Green/Some text D,
1795 Blue/Some text E
1796 }
1797 \end{tikzpicture}
1798 \end{codeexample}
1799 \end{key}
1800 \begin{key}{/wheelchart/slices arc inner end=\opt{\meta{boolean}} (default true, initially false)}
1801 If true then the keys |slices end arc|, |slices inner arc| and |slices start arc| are set such that the inner part and the end of each of the slices of the wheelchart form one arc and such that the start has the opposite curvature as the end.
1802 \begin{codeexample}[width=10cm]
1803 \begin{tikzpicture}[font=\scriptsize]
1804 \foreach\a/\x in {0/0,45/4.5}{
1805 \wheelchart[
1806 at={(\x,0)},
1807 data=,
1808 gap,
1809 radius={1}{2.2},
1810 slices arc inner end,
1811 slices outer angle shift=\a,
1812 value=1,
1813 wheel data=\WCvarC,
1814 wheel data angle pos=0.6
1815 ]{\exampleforthismanual}
1816 }
1817 \end{tikzpicture}
1818 \end{codeexample}
1819 \end{key}
1820 \begin{key}{/wheelchart/slices arc inner end start=\opt{\meta{boolean}} (default true, initially false)}
1821 If true then the keys |slices end arc|, |slices inner arc| and |slices start arc| are set such that the inner part and the end of each of the slices of the wheelchart form one arc and such that the start has the same curvature as the end.
1822 \begin{codeexample}[]
1823 \begin{tikzpicture}
1824 \foreach\a/\x in {-60/0,0/4.5,60/10}{
1825 \wheelchart[
1826 at={(\x,0)},
1827 radius={0.66}{2},
1828 slices arc inner end start,
1829 slices inner angle shift=\a,
1830 slices style={fill=none,draw=Turquoise,ultra thick},
1831 total count=20
1832 ]{}
1833 }
1834 \end{tikzpicture}
1835 \end{codeexample}
1836 \end{key}
1837 \begin{key}{/wheelchart/slices arc inner start=\opt{\meta{boolean}} (default true, initially false)}
1838 If true then the keys |slices end arc|, |slices inner arc| and |slices start arc| are set such that the inner part and the start of each of the slices of the wheelchart form one arc and such that the end has the opposite curvature as the start.
1839 \begin{codeexample}[width=10cm]
1840 \begin{tikzpicture}
1841 \wheelchart[
1842 middle={
1843 slices arc\\
1844 inner start,\\
1845 slices inner\\
1846 angle shift=90
1847 },
1848 middle style={font=\ttfamily},
1849 slices arc inner start,
1850 slices inner angle shift=90
1851 ]{
1852 1/Goldenrod/,
1853 1/Mahogany/,
1854 1/JungleGreen/,
1855 1/RoyalBlue/
1856 }
1857 \end{tikzpicture}
1858 \end{codeexample}
1859 \end{key}
1860 \begin{key}{/wheelchart/slices arc inner start end=\opt{\meta{boolean}} (default true, initially false)}
1861 If true then the keys |slices end arc|, |slices inner arc| and |slices start arc| are set such that the inner part and the start of each of the slices of the wheelchart form one arc and such that the end has the same curvature as the start.
1862 \begin{codeexample}[width=10cm]
1863 \begin{tikzpicture}
1864 \wheelchart[
1865 data=,
1866 gap polar=5,
1867 middle=
1868 slices arc\\
1869 inner start end,
1870 middle style={font=\ttfamily},
1871 slices arc inner start end,
1872 value=1,
1873 wheel data=\WCvarC,
1874 wheel data pos=0.4
1875 ]{\exampleforthismanual}
1876 \end{tikzpicture}
1877 \end{codeexample}
1878 \end{key}
1879 \begin{key}{/wheelchart/slices arc match=\marg{arg 1}\marg{num 1}\marg{num 2}\marg{num 3}\marg{arg 2}\marg{arg 3}\marg{arg 4}}
1880 This key modifies the shape of the slices according to the $7$ arguments.
1881
1882 Here, \meta{arg 1} must be |end|, |inner|, |outer| or |start| and \meta{arg 2}, \meta{arg 3} and \meta{arg 4} must be |inner end|, |inner start|, |outer end| or |outer start|. For example, the key |slices arc inner end| sets |slices arc match={inner}{1}{-1}{1}{inner end}{inner start}{outer end}|.
1883 \begin{codeexample}[width=10cm]
1884 \begin{tikzpicture}
1885 \foreach\a/\b/\x in
1886 {end/1/0,inner/-1/4.8}{
1887 \wheelchart[
1888 at={(\x,0)},
1889 radius={0.66}{2},
1890 slices arc match=
1891 {\a}{\b}{1}{1}{inner end}
1892 {inner start}{outer end},
1893 slices inner angle shift=60,
1894 slices style={
1895 fill=none,
1896 draw=Turquoise
1897 },
1898 total count=20
1899 ]{}
1900 }
1901 \end{tikzpicture}
1902 \end{codeexample}
1903 \end{key}
1904 \begin{key}{/wheelchart/slices arc outer end=\opt{\meta{boolean}} (default true, initially false)}
1905 If true then the keys |slices end arc|, |slices outer arc| and |slices start arc| are set such that the outer part and the end of each of the slices of the wheelchart form one arc and such that the start has the opposite curvature as the end.
1906 \end{key}
1907 \begin{key}{/wheelchart/slices arc outer end start=\opt{\meta{boolean}} (default true, initially false)}
1908 If true then the keys |slices end arc|, |slices outer arc| and |slices start arc| are set such that the outer part and the end of each of the slices of the wheelchart form one arc and such that the start has the same curvature as the end.
1909 \begin{codeexample}[width=10cm]
1910 \begin{tikzpicture}
1911 \wheelchart[
1912 data=,
1913 gap polar=5,
1914 middle=
1915 slices arc\\
1916 outer end start,
1917 middle style={font=\ttfamily},
1918 slices arc outer end start,
1919 value=1,
1920 wheel data=\WCvarC
1921 ]{\exampleforthismanual}
1922 \end{tikzpicture}
1923 \end{codeexample}
1924 \end{key}
1925 \begin{key}{/wheelchart/slices arc outer start=\opt{\meta{boolean}} (default true, initially false)}
1926 If true then the keys |slices end arc|, |slices outer arc| and |slices start arc| are set such that the outer part and the start of each of the slices of the wheelchart form one arc and such that the end has the opposite curvature as the start.
1927 \begin{codeexample}[width=10cm]
1928 \begin{tikzpicture}
1929 \wheelchart[
1930 data=,
1931 gap=0.1,
1932 slices arc inner start,
1933 slices arc outer start,
1934 slices style={
1935 \WCvarB!50,
1936 draw=\WCvarB,
1937 ultra thick
1938 },
1939 value=1,
1940 wheel data=\WCcount,
1941 wheel data pos=0.8
1942 ]{\exampleforthismanual}
1943 \end{tikzpicture}
1944 \end{codeexample}
1945 \begin{codeexample}[]
1946 \begin{tikzpicture}
1947 \foreach\a/\x in {0/0,45/5,90/10}{
1948 \wheelchart[
1949 at={(\x,0)},
1950 data=,
1951 gap,
1952 radius={0.66}{2},
1953 slices arc outer start,
1954 slices outer angle shift=\a,
1955 value=1
1956 ]{\exampleforthismanual}
1957 }
1958 \end{tikzpicture}
1959 \end{codeexample}
1960 \end{key}
1961 \begin{key}{/wheelchart/slices arc outer start end=\opt{\meta{boolean}} (default true, initially false)}
1962 If true then the keys |slices end arc|, |slices outer arc| and |slices start arc| are set such that the outer part and the start of each of the slices of the wheelchart form one arc and such that the end has the same curvature as the start.
1963 \end{key}
1964 \begin{key}{/wheelchart/slices Arrow=\marg{angle}}
1965 This key sets |slices end| to |--(\WCpoint{1}{|\meta{angle}|}{0.5}{0})--(\WCpoint{1}{0}{0}{0})| and |slices start| to |--(\WCpoint{0}{|\meta{angle}|}{0.5}{0})--cycle|.
1966 \end{key}
1967 \begin{key}{/wheelchart/slices arrow=\marg{value 1}\marg{value 2}}
1968 This key is similar to the key |slices arc| but draws an arrow.
1969 \begin{codeexample}[width=10cm]
1970 \begin{tikzpicture}
1971 \wheelchart[
1972 gap=0.3,
1973 slices arrow={1}{-1}
1974 ]{\exampleforthismanual}
1975 \end{tikzpicture}
1976 \end{codeexample}
1977 The example below compares arrows constructed with the key |slices Arrow| and the key |slices arrow|. Using the key |slices Arrow|, the arrow tip lies on the circle but the line segments do \emph{not} have the same length. Using the key |slices arrow|, the arrow tip does \emph{not} lie on the circle but the line segments have the same length.
1978 \begin{codeexample}[width=10cm]
1979 \begin{tikzpicture}
1980 \wheelchart[
1981 gap=0.3,
1982 middle=slices Arrow,
1983 middle style={font=\ttfamily},
1984 slices Arrow=10,
1985 slices style={
1986 fill=none,
1987 draw=Bittersweet
1988 },
1989 total count=3
1990 ]{}
1991 \draw (0,0) circle[radius=2.5];
1992 \wheelchart[
1993 at={(0,-7)},
1994 gap=0.3,
1995 middle=slices arrow,
1996 middle style={font=\ttfamily},
1997 slices arrow={1}{0},
1998 slices style={
1999 fill=none,
2000 draw=CadetBlue
2001 },
2002 total count=3
2003 ]{}
2004 \draw (0,-7) circle[radius=2.5];
2005 \end{tikzpicture}
2006 \end{codeexample}
2007 \end{key}
2008 \begin{key}{/wheelchart/slices end=\marg{path}}
2009 This key determines the end of the slice. Initially, this is a line segment from the outer end to the inner end of the slice.
2010 \end{key}
2011 \begin{key}{/wheelchart/slices end arc=\marg{value 1}\marg{value 2}}
2012 This key determines the end of the slice.
2013
2014 The effect of \meta{value 1} and \meta{value 2} is shown in the figure and the table below.
2015
2016 If $\text{\meta{value 1}}>0$ then the arc points outwards the slice. If $\text{\meta{value 1}}<0$ then the arc points inwards the slice. Here, outwards and inwards are relative to the orientation of the four-sided polygon formed by the points whose coordinates are determined by the inner and outer radius of the first slice and the start angle and the angle at the inverse of the key |samples| between the start angle and the end angle of the first slice. If the start angle and the end angle of the first slice are equal then the end angle of the last slice is used instead. If this test is inconclusive then the orientation is set according to the key |counterclockwise|.
2017
2018 If $\text{\meta{value 1}}=0$ then a line segment is drawn.
2019
2020 If \meta{value 1} and \meta{value 2} are negative then an arc is drawn which behaves the same as an arc with $\text{\meta{value 2}}=0$ and such that its radius matches the radius of the arc corresponding to setting \meta{value 1} to its opposite. This is illustrated in the table below.
2021 \begin{center}
2022 \begin{tikzpicture}[scale=3]
2023 \wheelchart[
2024 slices end arc={2}{0.5},
2025 slices style={
2026 fill=none,
2027 draw=Cyan,
2028 ultra thick
2029 },
2030 xbar={1}{1}
2031 ]{1//}
2032 \draw[<->] (1,0.5)--(1.5,0.5) node[below,midway] {$a$};
2033 \draw[<->] (1,0.5)--(1,0.75) node[left,midway] {$b$};
2034 \draw[<->] (1,0.75)--(1,1) node[left,midway] {$c$};
2035 \draw[<->] (0.75,0.5)--(0.75,1) node[left,midway] {$d$};
2036 \node[right] at (2,0.5) {$\lvert\text{\meta{value 1}}\rvert=\frac{a}{b},\ \lvert\text{\meta{value 2}}\rvert=\frac{c}{d}$};
2037 \end{tikzpicture}
2038
2039 \newcommand{\exampleslicesarc}[2]{%
2040 \begin{tikzpicture}[baseline={(0,0.5)}]
2041 \ifdim #1 pt<0pt
2042 \ifdim #2 pt<0pt
2043 \edef\r{\fpeval{0.25*((#2)-1)*(1/(#1)+(#1))}}
2044 \wheelchart[
2045 at={({1.5+sqrt((\r)^2-0.25)-(#1)*0.5*(1-(#2))-\r},0)},
2046 slices start arc={-(#1)}{#2},
2047 slices style={
2048 fill=none,
2049 draw=Goldenrod,
2050 ultra thick
2051 },
2052 xbar={0.5}{1}
2053 ]{1//}
2054 \fi
2055 \fi
2056 \wheelchart[
2057 slices end arc={#1}{#2},
2058 slices style={
2059 fill=none,
2060 draw
2061 },
2062 xbar={1.5}{1}
2063 ]{1//}
2064 \useasboundingbox ($(current bounding box.south west)-(2pt,2pt)$) rectangle ($(current bounding box.north east)+(2pt,2pt)$);
2065 \end{tikzpicture}%
2066 }
2067 \newcommand{\exampleslicesarcrow}[1]{$\text{\meta{value 1}}=#1$ & \exampleslicesarc{#1}{-0.5} & \exampleslicesarc{#1}{0} & \exampleslicesarc{#1}{0.5}\\}
2068 \begin{tabular}{l|lll}
2069 & $\text{\meta{value 2}}=-0.5$ & $\text{\meta{value 2}}=0$ & $\text{\meta{value 2}}=0.5$\\\hline
2070 \exampleslicesarcrow{2}
2071 \exampleslicesarcrow{1}
2072 \exampleslicesarcrow{0}
2073 \exampleslicesarcrow{-1}
2074 \exampleslicesarcrow{-2}
2075 \end{tabular}
2076 \end{center}
2077 \begin{codeexample}[width=10cm]
2078 \begin{tikzpicture}
2079 \wheelchart[
2080 for loop start=
2081 \definecolor{WCcolor}{wave}{
2082 \fpeval{380+(\WCcount-1)*
2083 340/(\WCtotalcount-1)}
2084 },
2085 gap polar=180/\WCtotalcount,
2086 radius={1.5}{3},
2087 slices end arc={-0.6}{0},
2088 slices start arc={1.2}{0},
2089 slices style=WCcolor,
2090 total count=20
2091 ]{}
2092 \end{tikzpicture}
2093 \end{codeexample}
2094 \end{key}
2095 \begin{key}{/wheelchart/slices end arrow=\marg{value 1}\marg{value 2}}
2096 This key is similar to the key |slices end arc| but draws an arrow.
2097 \end{key}
2098 \begin{key}{/wheelchart/slices end to=\marg{value 1}\marg{value 2}}
2099 This key sets the |to| path operation for the end of the slice. The angle at the inner side is determined by \meta{value 1} and the angle at the outer side is determined by \meta{value 2}.
2100 \end{key}
2101 \begin{key}{/wheelchart/slices inner=\marg{path}}
2102 This key determines the inner part of the slice. Initially, this is an arc from the inner end to the inner start of the slice.
2103 \begin{codeexample}[width=10cm]
2104 \begin{tikzpicture}
2105 \def\a{5}
2106 \def\b{12}
2107 \wheelchart[
2108 data sep=0.3,
2109 gap=0.1,
2110 inner data=\WCcount,
2111 inner data sep=2-2*cos(\b),
2112 inner data style={
2113 circle,
2114 fill=\WCvarB!50
2115 },
2116 slices inner={
2117 arc[
2118 start angle=\WCangle{1}{0}{0}{0},
2119 end angle=\WCangle{0.5}{\b}{0}{0},
2120 radius=\WCradius{0}{0}
2121 ]
2122 arc[
2123 start angle=\WCmidangle-90,
2124 end angle=\WCmidangle+90,
2125 radius=2*sin(\b)
2126 ]
2127 arc[
2128 start angle=
2129 \WCangle{0.5}{-\b}{0}{0},
2130 end angle=\WCangle{0}{0}{0}{0},
2131 radius=\WCradius{0}{0}
2132 ]
2133 },
2134 slices outer={
2135 arc[
2136 start angle=\WCangle{0}{0}{1}{0},
2137 end angle=\WCangle{0.5}{-\a}{1}{0},
2138 radius=\WCradius{1}{0}
2139 ]
2140 --(\WCpoint{0.5}{0}{1}{0.3})
2141 --(\WCpoint{0.5}{\a}{1}{0})
2142 arc[
2143 start angle=
2144 \WCangle{0.5}{\a}{1}{0},
2145 end angle=\WCangle{1}{0}{1}{0},
2146 radius=\WCradius{1}{0}
2147 ]
2148 },
2149 slices style={
2150 draw=\WCvarB,
2151 fill=\WCvarB!25,
2152 ultra thick
2153 },
2154 value=1
2155 ]{\exampleforthismanual}
2156 \end{tikzpicture}
2157 \end{codeexample}
2158 \end{key}
2159 \begin{key}{/wheelchart/slices inner angle reduce=\marg{angle}}
2160 This key sets |slices inner end angle shift| to $-\text{\meta{angle}}$ and |slices inner start angle shift| to \meta{angle}.
2161 \end{key}
2162 \begin{key}{/wheelchart/slices inner angle shift=\marg{angle}}
2163 This key sets |slices inner end angle shift| and |slices inner start angle shift| to \meta{angle}.
2164 \begin{codeexample}[width=10cm]
2165 \begin{tikzpicture}
2166 \wheelchart[
2167 data=,
2168 middle={
2169 slices inner\\
2170 angle shift=90
2171 },
2172 middle style={font=\ttfamily},
2173 slices inner angle shift=90
2174 ]{\exampleforthismanual}
2175 \end{tikzpicture}
2176 \end{codeexample}
2177 \begin{codeexample}[width=10cm]
2178 \begin{tikzpicture}
2179 \wheelchart[
2180 data=,
2181 gap,
2182 radius={1}{3},
2183 slices arc={0.5}{0},
2184 slices inner angle shift=45,
2185 value=1,
2186 wheel data=\WCvarC,
2187 wheel data angle pos=0.8
2188 ]{\exampleforthismanual}
2189 \end{tikzpicture}
2190 \end{codeexample}
2191 \begin{codeexample}[]
2192 \begin{tikzpicture}
2193 \foreach\a/\x in {-60/0,0/5.6,60/10}{
2194 \wheelchart[
2195 at={(\x,0)},
2196 radius={0.66}{2},
2197 slices arc inner start,
2198 slices inner angle shift=\a,
2199 slices style={fill=\WClistcolors},
2200 total count=40,
2201 WClistcolors={RedOrange,none}
2202 ]{}
2203 }
2204 \end{tikzpicture}
2205 \end{codeexample}
2206 \begin{codeexample}[width=10cm]
2207 \begin{tikzpicture}[font=\small]
2208 \pgfkeys{
2209 /wheelchart,
2210 data=,
2211 inner data=\WCcount,
2212 inner data pos=0.1,
2213 inner data sep=0,
2214 radius={1}{2.4},
2215 slices inner angle shift=
2216 90-180/\WCtotalcount,
2217 slices inner arc={0}{0},
2218 value=1,
2219 wheel data=\WCvarC
2220 }
2221 \wheelchart{\exampleforthismanual}
2222 \wheelchart[
2223 at={(4.8,0)},
2224 slices outer arc={0}{0},
2225 wheel data pos=0.58
2226 ]{\exampleforthismanual}
2227 \end{tikzpicture}
2228 \end{codeexample}
2229 \end{key}
2230 \begin{key}{/wheelchart/slices inner arc=\marg{value 1}\marg{value 2}}
2231 This key is similar to the key |slices end arc| but sets the inner part of the slice.
2232 \end{key}
2233 \begin{key}{/wheelchart/slices inner arc tangent=\opt{\meta{boolean}} (default true, initially false)}
2234 If true then the key |slices inner arc| is set such that the arc is tangent to the end and start of the slice if possible. Note that this is not possible for all settings for keys such as |plot| and |slices inner angle shift|.
2235 \begin{codeexample}[width=10cm]
2236 \begin{tikzpicture}
2237 \wheelchart[
2238 counterclockwise,
2239 data=,
2240 gap=0.1,
2241 middle=slices inner\\arc tangent,
2242 middle style={font=\ttfamily},
2243 slices inner arc tangent,
2244 slices style={
2245 draw=\WCvarB,
2246 fill=\WCvarB!50,
2247 ultra thick
2248 },
2249 value=1
2250 ]{\exampleforthismanual}
2251 \end{tikzpicture}
2252 \end{codeexample}
2253 \end{key}
2254 \begin{key}{/wheelchart/slices inner arrow=\marg{value 1}\marg{value 2}}
2255 This key is similar to the key |slices end arrow| but sets the inner part of the slice.
2256 \begin{codeexample}[width=10cm]
2257 \begin{tikzpicture}
2258 \def\n{10}
2259 \wheelchart[
2260 radius={0}{1.5},
2261 slices outer arrow={cot(180/\n)}{0},
2262 slices style{list}={
2263 BurntOrange,RedOrange
2264 },
2265 total count=\n
2266 ]{}
2267 \wheelchart[
2268 radius={3*cos(180/\n)}{3*cos(180/\n)},
2269 slices inner arrow={cot(360/\n)}{0},
2270 slices outer arrow={cot(360/\n)}{0},
2271 slices style{list}={
2272 Dandelion,Goldenrod
2273 },
2274 start half,
2275 total count=\n
2276 ]{}
2277 \end{tikzpicture}
2278 \end{codeexample}
2279 \end{key}
2280 \begin{key}{/wheelchart/slices inner end angle shift=\marg{angle} (initially 0)}
2281 The end angle of the inner part of the slice will be modified such that the angle between the end and the inner part of the slice is shifted with \meta{angle} (taking into account the key |counterclockwise|). The behavior of this key depends on whether a plot is used.
2282 \end{key}
2283 \begin{key}{/wheelchart/slices inner start angle shift=\marg{angle} (initially 0)}
2284 This key is similar to the key |slices inner end angle shift| but modifies the start angle of the inner part of the slice.
2285 \end{key}
2286 \begin{key}{/wheelchart/slices inner to=\marg{value 1}\marg{value 2}}
2287 This key sets the |to| path operation for the inner part of the slice. The angle at the start is determined by \meta{value 1} and the angle at the end is determined by \meta{value 2}.
2288 \end{key}
2289 \begin{key}{/wheelchart/slices outer=\marg{path}}
2290 This key determines the outer part of the slice. Initially, this is an arc from the outer start to the outer end of the slice.
2291 \end{key}
2292 \begin{key}{/wheelchart/slices outer angle reduce=\marg{angle}}
2293 This key sets |slices outer end angle shift| to $-\text{\meta{angle}}$ and |slices outer start angle shift| to \meta{angle}.
2294 \begin{codeexample}[width=10cm]
2295 \begin{tikzpicture}
2296 \wheelchart[
2297 data=,
2298 inner data=\WCcount,
2299 inner data style={
2300 circle,
2301 fill=white
2302 },
2303 slices inner arrow={1}{0},
2304 slices outer angle reduce=
2305 180/\WCtotalcount,
2306 slices outer arrow={0}{0},
2307 value=1,
2308 wheel data=\WCvarC,
2309 wheel data style={
2310 rotate=\WCmidangle-90
2311 }
2312 ]{\exampleforthismanual}
2313 \end{tikzpicture}
2314 \end{codeexample}
2315 \end{key}
2316 \begin{key}{/wheelchart/slices outer angle shift=\marg{angle}}
2317 This key sets |slices outer end angle shift| and |slices outer start angle shift| to \meta{angle}.
2318 \begin{codeexample}[width=10cm]
2319 \begin{tikzpicture}[looseness=2]
2320 \wheelchart[
2321 data=,
2322 inner data=\Large\WCcount,
2323 inner data pos=1.1,
2324 radius={1}{3},
2325 slices arc inner end,
2326 slices outer angle shift=80,
2327 slices outer to={80}{80},
2328 slices style={
2329 bottom color=\WCvarB,
2330 top color=\WCvarB!80!black,
2331 shading angle=\WCmidangle-90
2332 },
2333 value=1,
2334 wheel data=\WCvarC,
2335 wheel data angle pos=0.4,
2336 wheel data pos=0.8
2337 ]{\exampleforthismanual}
2338 \end{tikzpicture}
2339 \end{codeexample}
2340 \end{key}
2341 \begin{key}{/wheelchart/slices outer arc=\marg{value 1}\marg{value 2}}
2342 This key is similar to the key |slices end arc| but sets the outer part of the slice.
2343 \end{key}
2344 \begin{key}{/wheelchart/slices outer arc tangent=\opt{\meta{boolean}} (default true, initially false)}
2345 If true then the key |slices outer arc| is set such that the arc is tangent to the end and start of the slice if possible. Note that this is not possible for all settings for keys such as |plot| and |slices inner angle shift|.
2346 \begin{codeexample}[width=10cm]
2347 \begin{tikzpicture}
2348 \wheelchart[
2349 data=,
2350 gap=0.1,
2351 middle=slices outer\\arc tangent,
2352 middle style={font=\ttfamily},
2353 slices outer arc tangent,
2354 slices style={
2355 draw=\WCvarB,
2356 fill=\WCvarB!50,
2357 ultra thick
2358 },
2359 value=1
2360 ]{\exampleforthismanual}
2361 \end{tikzpicture}
2362 \end{codeexample}
2363 \end{key}
2364 \begin{key}{/wheelchart/slices outer arrow=\marg{value 1}\marg{value 2}}
2365 This key is similar to the key |slices end arrow| but sets the outer part of the slice.
2366 \begin{codeexample}[width=10cm]
2367 \begin{tikzpicture}[font=\scriptsize]
2368 \foreach\a/\x in
2369 {1/0,{tan(180/\WCtotalcount)}/5}{
2370 \wheelchart[
2371 at={(\x,0)},
2372 data=,
2373 gap,
2374 radius={0.66}{2},
2375 slices outer arrow={\a}{0},
2376 start half,
2377 value=1,
2378 wheel data=\WCvarC
2379 ]{\exampleforthismanual}
2380 }
2381 \end{tikzpicture}
2382 \end{codeexample}
2383 \begin{codeexample}[width=10cm]
2384 \begin{tikzpicture}
2385 \pgfkeys{
2386 /wheelchart,
2387 data=,
2388 radius={1}{1.5},
2389 value=1
2390 }
2391 \wheelchart[
2392 slices inner arrow={0}{0}
2393 ]{\exampleforthismanual}
2394 \wheelchart[
2395 at={(3.25,0)},
2396 slices outer arrow={0}{0}
2397 ]{\exampleforthismanual}
2398 \wheelchart[
2399 at={(6.5,0)},
2400 slices inner arrow={0}{0},
2401 slices outer arrow={0}{0}
2402 ]{\exampleforthismanual}
2403 \end{tikzpicture}
2404 \end{codeexample}
2405 \begin{codeexample}[width=10cm]
2406 \begin{tikzpicture}
2407 \foreach\r/\s/\a in
2408 {3/0/0.5,2/15/1,1/30/0.7}{
2409 \wheelchart[
2410 radius={0.5}{\r},
2411 slices outer arrow={\a}{0},
2412 slices style={
2413 fill=\WClistcolors!20,
2414 draw=\WClistcolors,
2415 ultra thick,
2416 double
2417 },
2418 start half=\s,
2419 total count=12,
2420 WClistcolors={CarnationPink,Orchid}
2421 ]{}
2422 }
2423 \end{tikzpicture}
2424 \end{codeexample}
2425 \end{key}
2426 \begin{key}{/wheelchart/slices outer end angle shift=\marg{angle} (initially 0)}
2427 The end angle of the outer part of the slice will be modified such that the angle between the end and the inner (not the outer) part of the slice is shifted with \meta{angle} (taking into account the key |counterclockwise|). The behavior of this key depends on whether a plot is used.
2428 \end{key}
2429 \begin{key}{/wheelchart/slices outer start angle shift=\marg{angle} (initially 0)}
2430 This key is similar to the key |slices outer end angle shift| but modifies the start angle of the outer part of the slice.
2431 \end{key}
2432 \begin{key}{/wheelchart/slices outer to=\marg{value 1}\marg{value 2}}
2433 This key sets the |to| path operation for the outer part of the slice. The angle at the start is determined by \meta{value 1} and the angle at the end is determined by \meta{value 2}.
2434 \begin{codeexample}[width=10cm]
2435 \begin{tikzpicture}[looseness=3]
2436 \wheelchart[
2437 data=,
2438 radius={0}{2.5},
2439 slices arc={0.4}{0},
2440 slices outer to={70}{70},
2441 start half,
2442 value=1,
2443 wheel data=\WCvarC,
2444 wheel data pos=1
2445 ]{\exampleforthismanual}
2446 \end{tikzpicture}
2447 \end{codeexample}
2448 \end{key}
2449 \begin{key}{/wheelchart/slices pos=\marg{value} (initially 0.5)}
2450 This key determines the position of the slices if the key |slices| is used similar as the corresponding key for the key |data|.
2451 \end{key}
2452 \begin{stylekey}{/wheelchart/slices scope=\marg{options} (initially \normalfont empty)}
2453 This key accepts a list of keys which will be applied to the scope in which the slices of the wheelchart, the wheel lines determined by the key |wheel lines| and the different kinds of data are placed.
2454 \begin{codeexample}[width=10cm]
2455 \begin{tikzpicture}
2456 \wheelchart[
2457 data=,
2458 radius={3.9}{4.5},
2459 slices inner arc={0}{0},
2460 slices outer angle reduce=5*90/7,
2461 slices outer arc={0}{0},
2462 slices scope={
2463 shift={
2464 ($(90+\WCmidangle:0.559572)
2465 +(\WCmidangle:-1.16196)$)
2466 }
2467 },
2468 value=1,
2469 wheel data=\WCvarC,
2470 wheel data pos=0,
2471 wheel data style={
2472 rotate=\WCmidangle-90
2473 }
2474 ]{\exampleforthismanual}
2475 \end{tikzpicture}
2476 \end{codeexample}
2477 \begin{codeexample}[width=10cm,preamble={\usepackage{siunitx}}]
2478 \begin{tikzpicture}
2479 \wheelchart[
2480 data=
2481 \WCvarC\\
2482 \qty{\fpeval{\WCvarA/2}}{\percent},
2483 radius={0.5}{0.5+0.1*\WCvarA},
2484 slices inner arc tangent,
2485 slices outer angle reduce=
2486 180/\WCtotalcount,
2487 slices outer arc tangent,
2488 slices scope={shift={(\WCmidangle:
2489 {-cos(180/\WCtotalcount)/2})}},
2490 value=1
2491 ]{\exampleforthismanual}
2492 \end{tikzpicture}
2493 \end{codeexample}
2494 \end{stylekey}
2495 \begin{key}{/wheelchart/slices sep=\marg{value} (initially 0)}
2496 This key determines the position of the slices if the key |slices| is used similar as the corresponding key for the key |data|.
2497 \end{key}
2498 \begin{key}{/wheelchart/slices start=\marg{path}}
2499 This key determines the start of the slice. Initially, this is a line segment from the inner start to the outer start of the slice.
2500 \end{key}
2501 \begin{key}{/wheelchart/slices start arc=\marg{value 1}\marg{value 2}}
2502 This key is similar to the key |slices end arc| but sets the start of the slice.
2503 \end{key}
2504 \begin{key}{/wheelchart/slices start arrow=\marg{value 1}\marg{value 2}}
2505 This key is similar to the key |slices end arrow| but sets the start of the slice.
2506 \end{key}
2507 \begin{key}{/wheelchart/slices start to=\marg{value 1}\marg{value 2}}
2508 This key sets the |to| path operation for the start of the slice. The angle at the inner side is determined by \meta{value 1} and the angle at the outer side is determined by \meta{value 2}.
2509 \end{key}
2510 \begin{stylekey}{/wheelchart/slices style=\marg{options} (initially \textbackslash WCvarB)}
2511 This key defines the style of the slices of the wheelchart.
2512 \end{stylekey}
2513 \begin{key}{/wheelchart/slices to=\marg{value 1}\marg{value 2}}
2514 This key sets |slices end to| and |slices start to| but uses the opposite respective values for |slices start to|.
2515 \begin{codeexample}[width=10cm]
2516 \begin{tikzpicture}[looseness=2]
2517 \wheelchart[
2518 radius={1}{3},
2519 slices inner angle shift=90,
2520 slices inner arc={0}{0},
2521 slices outer to={70}{70},
2522 slices style{list}={Maroon,Salmon},
2523 slices to={30}{30},
2524 total count=6
2525 ]{}
2526 \end{tikzpicture}
2527 \end{codeexample}
2528 \end{key}
2529 \begin{stylekey}{/wheelchart/slice\marg{range}=\marg{options} (initially \normalfont empty)}
2530 This key accepts a list of keys from the wheelchart key family. The \meta{range} is mandatory and must be non-empty. It is processed with |\foreach| with the option |parse=true|. Hereafter the elements are processed with |\fp_eval:n|. The \meta{options} will only be applied to a slice if the number of the slice is in the \meta{range}. The \meta{range} only makes sense for a key which is processed for each slice. For example, the \meta{range} does not make sense for the key |middle|.
2531 \end{stylekey}
2532 \begin{key}{/wheelchart/start angle=\marg{angle} (initially 90)}
2533 This key defines the \meta{angle} in degrees at which the first slice of the wheelchart starts.
2534 \end{key}
2535 \begin{key}{/wheelchart/start half=\marg{angle} (default 90)}
2536 This key sets the start angle such that the middle of the first slice of the wheelchart is positioned at \meta{angle} in degrees.
2537 \end{key}
2538 \begin{key}{/wheelchart/title=\marg{text} (initially \normalfont empty)}
2539 This key contains the \meta{text} which will be placed above the wheelchart. The \meta{text} is placed in a node. The $x$ coordinate of this node is the $x$ coordinate of the center of the wheelchart, which is defined by the key |at|. In general, this is \emph{not} the same as the $x$ coordinate of the center of the |local bounding box| around the wheelchart. The $y$ coordinate of this node is at a value determined by the key |title sep| above the north of the |local bounding box| around the wheelchart. The style of this node is given as follows. First, the options |anchor=south,align=center| are given. Thereafter, the style of the key |title style| is added.
2540 \end{key}
2541 \begin{key}{/wheelchart/title left=\marg{text} (initially \normalfont empty)}
2542 This key contains the \meta{text} which will be placed above left of the wheelchart. The \meta{text} is placed in a node. This node is placed at a value determined by the key |title left sep| above the north west of the |local bounding box| around the wheelchart. The style of this node is given as follows. First, the options |anchor=south west,align=left| are given. Thereafter, the style of the key |title left style| is added.
2543 \end{key}
2544 \begin{key}{/wheelchart/title left sep=\marg{value} (initially 0.5)}
2545 The node where the contents of the key |title left| is placed is at \meta{value} above the north west of the |local bounding box| around the wheelchart.
2546 \end{key}
2547 \begin{stylekey}{/wheelchart/title left style=\marg{options} (initially \normalfont empty)}
2548 This key accepts a list of keys which will be applied to the node where the contents of the key |title left| is placed.
2549 \end{stylekey}
2550 \begin{key}{/wheelchart/title sep=\marg{value} (initially 0.5)}
2551 The $y$ coordinate of the node where the contents of the key |title| is placed is at \meta{value} above the north of the |local bounding box| around the wheelchart.
2552 \end{key}
2553 \begin{stylekey}{/wheelchart/title style=\marg{options} (initially \normalfont empty)}
2554 This key accepts a list of keys which will be applied to the node where the contents of the key |title| is placed.
2555 \end{stylekey}
2556 \begin{key}{/wheelchart/total angle=\marg{angle} (initially 360)}
2557 This key defines the total \meta{angle} in degrees of the wheelchart.
2558 \end{key}
2559 \begin{key}{/wheelchart/total count=\marg{number}}
2560 If this key is set then the number of slices of the wheelchart is determined by \meta{number}. Moreover, |\WCvarA| is defined as |1| and |\WCvarB| and |\WCvarC| are defined to be empty.
2561 \begin{codeexample}[width=10cm,preamble={\usepackage{siunitx}}]
2562 \begin{tikzpicture}
2563 \def\n{57}
2564 \wheelchart[
2565 gap=0.015,
2566 middle=\Huge\qty{\n}{\percent},
2567 slices style=Gray,
2568 slices style{1,...,\n}=Cyan,
2569 total count=100
2570 ]{}
2571 \end{tikzpicture}
2572 \end{codeexample}
2573 \end{key}
2574 \begin{key}{/wheelchart/triangle proportional area=\marg{width}\marg{height}}
2575 This key configures the plot such that a triangular shape is obtained. The value is proportional to the area and \emph{not} to the height. Moreover, it sets |samples=2| and |wheel data pos=0.5|. The point $(0,0)$ is at the top. This can be shifted with the key |at|.
2576 \begin{codeexample}[width=10cm]
2577 \begin{tikzpicture}
2578 \wheelchart[
2579 triangle proportional area={5}{4},
2580 value=1
2581 ]{\exampleforthismanual}
2582 \end{tikzpicture}
2583 \end{codeexample}
2584 \end{key}
2585 \begin{key}{/wheelchart/triangle proportional height=\marg{width}\marg{height}}
2586 This key configures the plot such that a triangular shape is obtained. The value is proportional to the height and \emph{not} to the area. Moreover, it sets |samples=2| and |wheel data pos=0.5|. The point $(0,0)$ is at the top. This can be shifted with the key |at|.
2587 \begin{codeexample}[width=10cm]
2588 \begin{tikzpicture}
2589 \wheelchart[
2590 triangle proportional height={5}{4},
2591 value=1
2592 ]{\exampleforthismanual}
2593 \end{tikzpicture}
2594 \end{codeexample}
2595 \end{key}
2596 \begin{key}{/wheelchart/value=\marg{value} (initially \textbackslash WCvarA)}
2597 This key defines the \meta{value} which corresponds to the size of each slice of the wheelchart.
2598 \end{key}
2599 \begin{key}{/wheelchart/WClist\meta{name}=\marg{list}}
2600 This key locally defines a macro |\WClist|\meta{name} which gives the element in the \meta{list} with as index |\WCcount| modulo the length of the \meta{list}. The \meta{list} is expanded once and processed using a |clist|. In particular, blank arguments are ignored. An empty argument in the \meta{list} can be obtained with |{}|. Items containing a |,| can be obtained by surrounding it with |{| and |}| such as |WClistA={{a,b},{c,d}}|.
2601
2602 If |\def\mylist{a,b,c}| and |WClistA=\mylist| then |\WClistA| gives |a,b,c| for each slice. On the other hand, if |WClistA/.expanded=\mylist| then |\WClistA| alternates between |a|, |b| and |c|.
2603 \end{key}
2604 \begin{key}{/wheelchart/wheel data=\marg{text} (initially \normalfont empty)}
2605 This key contains the \meta{text} which will be placed on top of each slice of the wheelchart. The \meta{text} is placed in a node. The style of this node is given as follows. First, the option |align=left| is given. Thereafter, the style of the key |wheel data style| is added.
2606 \end{key}
2607 \begin{key}{/wheelchart/wheel data angle pos=\marg{value} (initially 0.5)}
2608 \end{key}
2609 \begin{key}{/wheelchart/wheel data angle shift=\marg{angle} (initially 0)}
2610 \end{key}
2611 \begin{key}{/wheelchart/wheel data pos=\marg{value} (initially 0.66)}
2612 \end{key}
2613 \begin{key}{/wheelchart/wheel data sep=\marg{value} (initially 0)}
2614 These keys determine the position of the contents of the key |wheel data| similar as the corresponding keys for the key |data|.
2615 \end{key}
2616 \begin{stylekey}{/wheelchart/wheel data style=\marg{options} (initially \normalfont empty)}
2617 This key accepts a list of keys which will be applied to the node where the contents of the key |wheel data| is placed.
2618 \end{stylekey}
2619 \begin{stylekey}{/wheelchart/wheel lines=\marg{options} (initially \normalfont empty)}
2620 If this key is set then lines with the style determined by this key will be drawn inside the slices of the wheelchart. The number of these lines depends on the value of the key |value|.
2621
2622 Below is the example from \cite[Subsection 7.6]{TtTaPGFp} recreated with the package |wheelchart|.
2623 \begin{codeexample}[width=10cm,preamble={\usepackage{siunitx}}]
2624 \begin{tikzpicture}
2625 \colorlet{good}{green!75!black}
2626 \colorlet{bad}{red}
2627 \colorlet{neutral}{black!60}
2628 \colorlet{none}{white}
2629 \wheelchart[
2630 anchor xsep=15,
2631 contour=gray,
2632 data=``\WCvarC'': \WCvarA{} (\WCperc),
2633 middle=Ratings given by\\\WCtotalnum{} participants,
2634 radius={1.8}{2.2},
2635 start half=270,
2636 wheel lines={black!15,thick}
2637 ]{
2638 10/neutral/ok,
2639 9/good!60!white/good,
2640 3/good/very good,
2641 20/none/none,
2642 0/bad/very bad,
2643 8/bad!60!white/bad
2644 }
2645 \end{tikzpicture}
2646 \end{codeexample}
2647 \end{stylekey}
2648 \begin{key}{/wheelchart/xbar=\marg{width}\marg{height}}
2649 This key sets |domain=0:|\marg{width}, |plot={{#1},{#2}}|, |radius={0}|\marg{height}, |samples=2| and also |wheel data pos=0.5|. The point $(0,0)$ is below left of the bar. This can be shifted with the key |at|. Note that since this key sets in particular the outer parts of the slices, keys such as |slices outer arc| must be placed \emph{after} the key |xbar| to be applied.
2650 \begin{codeexample}[width=10cm]
2651 \begin{tikzpicture}
2652 \wheelchart[
2653 data pos{list}={1,0},
2654 data style={anchor=mid},
2655 gap polar=0.05,
2656 slices arrow={1}{0},
2657 xbar={8}{1.5}
2658 ]{\exampleforthismanual}
2659 \end{tikzpicture}
2660 \end{codeexample}
2661 \end{key}
2662 \begin{key}{/wheelchart/ybar=\marg{width}\marg{height}}
2663 This key sets |domain=0:|\marg{height}, |plot={{#2},{#1}}|, |radius={0}|\marg{width}, |samples=2| and also |wheel data pos=0.5|. The point $(0,0)$ is below left of the bar. This can be shifted with the key |at|.
2664 \begin{codeexample}[width=10cm]
2665 \begin{tikzpicture}
2666 \wheelchart[
2667 inner data=\WCperc,
2668 inner data style=left,
2669 ybar={1}{4}
2670 ]{\exampleforthismanual}
2671 \end{tikzpicture}
2672 \end{codeexample}
2673 \end{key}
2674 \section{Additional examples}
2675 The following example is an answer to the question on \url{https://tex.stackexchange.com/questions/433848/is-there-a-way-to-make-sunburst-charts-multi-level-pie-charts-in-latex}.
2676 \catcode`|=12%
2677 \begin{codeexample}[preamble={\usepackage{etoolbox}
2678 \usepackage{listofitems}
2679 \usetikzlibrary{decorations.text}}]
2680 \begin{tikzpicture}
2681 \sffamily
2682 \readlist\WCcolors{orange!50,orange!75,orange}
2683 \pgfkeys{
2684 /wheelchart,
2685 arc data=\WCvarB,
2686 arc data dir=\WCmidangle<180?-1:1,
2687 arc data pos=0.5,
2688 arc data style={text color=white},
2689 counterclockwise,
2690 data=,
2691 gap,
2692 gap radius,
2693 slices style={
2694 /utils/exec=
2695 \ifdefempty{\WCvarB}{
2696 \def\WCcolor{none}
2697 \def\WCoverlay{true}
2698 }{
2699 \edef\WCcolor{\WCcolors[\fpeval{\WCmidangle<90?1:(\WCmidangle<210?2:(\WCmidangle<270?3:1))}]}
2700 \def\WCoverlay{false}
2701 },
2702 fill=\WCcolor,
2703 overlay=\WCoverlay
2704 }
2705 }
2706 \wheelchart[
2707 middle=Root\\Node,
2708 middle style=darkgray,
2709 radius={1}{2}
2710 ]{2/Node 1,1/Node 2,3/Node 3}
2711 \wheelchart[
2712 radius={2}{3}
2713 ]{4/Sub1,4/Sub2,4/Sub3,3/Sub1,3/Sub2,6/Sub1,6/Sub2,3/Sub3,3/Sub4}
2714 \wheelchart[
2715 radius={3}{4}
2716 ]{4/Sub1-Sub1,20/,3/Sub2-Sub1,3/Sub2-Sub2,6/}
2717 \end{tikzpicture}
2718 \end{codeexample}
2719 \catcode`|=13%
2720 The following example is an answer to the question on \url{https://tex.stackexchange.com/questions/447920/pie-chart-with-color-palette-info-inside-and-legend}.
2721 \newgeometry{left=2pt,right=2pt,top=2.5cm,bottom=2.5cm}%
2722 \makeatletter%
2723 \f@nch@setoffs%
2724 \makeatother%
2725 \catcode`|=12%
2726 \begin{codeexample}[preamble={\usepackage{siunitx}
2727 \usetikzlibrary{decorations.text}}]
2728 \begin{tikzpicture}
2729 \ExplSyntaxOn
2730 \seq_set_from_clist:Nn \l_tmpa_seq { 190~ 30~ 46 , 240~ 65~ 54 , 241~ 90~ 43 , 247~148~ 30 , 43~ 56~144 , 28~117~188 , 40~170~225 ,
2731 119~179~225 , 181~212~239 , 0~104~ 56 , 0~148~ 69 , 57~181~ 74 , 141~199~ 63 , 215~244~ 34 ,
2732 249~237~ 50 , 248~241~148 , 242~245~205 , 123~ 82~ 49 , 104~ 73~158 , 102~ 45~145 , 148~149~151 }
2733 \seq_map_indexed_inline:Nn \l_tmpa_seq { \definecolor { slice#1 } { RGB } {#2} }
2734 \ExplSyntaxOff
2735 \definecolor{background}{RGB}{255 253 234}\definecolor{disc}{RGB}{ 15 119 188}
2736 \definecolor{text1}{RGB}{209 211 212}\definecolor{text2}{RGB}{ 67 66 63}
2737 \sisetup{group-separator={,},group-minimum-digits=4,text-series-to-math=true}
2738 \fill[background] (-6.8,-8) rectangle (13.8,8);
2739 \pgfkeys{/wheelchart,data=,radius={1.7}{5}}
2740 \wheelchart[
2741 arc data{18,21}=|\bfseries|\WCvarE{} \WCperc,
2742 arc data pos=1.2,
2743 arc data style={text color=slice\WCcount},
2744 inner data{1,...,20}=\qty{\WCvarC}{\percent}\\[-4pt]yield,
2745 inner data pos=0.5,
2746 inner data style=\WCvarB,
2747 legend entry={
2748 \fill[slice\WCcount,shift={({int((\WCcount-1)/17)*4.5-3},0)}] ({45-Mod(\WCcount-1,17)*90/16}:10) circle[radius=0.4]
2749 node[\WCvarB,font=\large] {\WCperc}
2750 node[black,shift={(0.6,0)},right,font=\footnotesize,align=left,execute at begin node={\baselineskip=7pt}] {\WCvarD};
2751 },
2752 lines{18,21}=0.75,
2753 lines sep=0.1,
2754 lines style={slice\WCcount,dashed,ultra thick},
2755 middle=Income\\[-4pt]\& growth\\\textcolor{slice21}{\Huge\pounds 100k}\\portfolio,
2756 middle fill=white,
2757 middle style={font=\bfseries\Large},
2758 slices style=slice\WCcount,
2759 wheel data=\Large \pounds\WCvarA k,
2760 wheel data{21}=\pounds\\[-4pt]\WCvarA\\[-4pt]k,
2761 wheel data pos=0.8,
2762 wheel data style=\WCvarB
2763 ]{
2764 5/text1/4.26/Miton Multi-Cap\\Income,
2765 6/text1/6.86/Schroder Income\\Maximiser,
2766 6/text1/3.82/Trojan\\Income,
2767 7/text1/3.32/CF Woodford\\Equity Income,
2768 7/text1/2.91/Artemis Global\\Income,
2769 4/text1/2.87/First State Global\\Listed Infrastructure,
2770 4/slice5/2.63/Lazard Global\\Listed Infrastructure,
2771 4/slice5/3.50/Legg Mason RARE\\Global Income,
2772 6/slice5/2.55/Newton Global\\Income,
2773 5/text1/4.6/Henderson\\Strategic Bond,
2774 4/text1/5.01/Invesco Perpetual\\Monthly Income Plus,
2775 5/text1/4.4/Jupiter Strategic\\Bond,
2776 4/slice11/0/L\&G All Stocks Index\\Linked Gilt Index,
2777 5/slice11/2.3/L\&G Short Dated Sterling\\Corporate Bond Index,
2778 4/slice11/5.95/Royal London Short Duration\\Global High Yield Bond,
2779 4/slice10/3.55/TwentyFour\\Corporate Bond,
2780 4/slice10/5.03/TwentyFour\\Dynamic Bond,
2781 5/text1/4.8/F\&C Property Growth\\\& Income/PROPERTY,
2782 5/text1/4.44/Aviva Multi Strategy\\Target Income,
2783 5/text1/3.45/Invesco\\Perpetual\\Global Targeted\\Income,
2784 1/text2/0.01/Cash/CASH
2785 }
2786 \pgfkeys{/wheelchart,arc{1,2,3,5}={draw=\WCvarB,dashed,ultra thick},arc around text,arc data{1,2,3,5}=|\bfseries|\WCvarC{} \WCvarA{\,}
2787 {\unit{\percent}},arc data pos=1.1,arc data style={text color=\WCvarB},arc pos=1.1,slices style={fill=none},value{5}=12}
2788 \wheelchart{
2789 24/slice1/UK EQUITIES,
2790 25/slice5/GLOBAL EQUITIES,
2791 35/slice10/FIXED INTEREST,
2792 3,
2793 10/slice20/ALTERNATIVE,
2794 1
2795 }
2796 \node[circle,fill=disc,text=white,font=\Large\bfseries,align=center] at (11.9,-5.5)
2797 {Portfolio\\[-4pt]income\\\pounds\num{3785}\\[10pt]\large or \qty{3.79}{\percent}};
2798 \node[rotate=270,below right] at (13.8,8) {\emph{Source: Whitechurch Securities}};
2799 \end{tikzpicture}
2800 \end{codeexample}
2801 \catcode`|=13%
2802 \restoregeometry%
2803 The following example is an answer to the question on \url{https://tex.stackexchange.com/questions/477310/cyclic-flowchart-in-tikz}.
2804 \catcode`|=12%
2805 \begin{codeexample}[width=10cm,preamble={\usetikzlibrary{decorations.text}}]
2806 \begin{tikzpicture}
2807 \sffamily
2808 \wheelchart[
2809 data=,
2810 middle=Optimized\\vibrating\\systems,
2811 middle fill=RoyalBlue,
2812 middle style=white,
2813 radius={1.2}{4},
2814 slices={(0,0) circle[radius=0.8];},
2815 slices style=\WCvarA,
2816 start half,
2817 value=1,
2818 wheel data=\WCvarB,
2819 wheel data pos=0.5,
2820 wheel data style={
2821 white,
2822 align=center
2823 }
2824 ]{
2825 Green/Passive\\control,
2826 Maroon/Feed-\\forward,
2827 Orange/Active\\control
2828 }
2829 \wheelchart[
2830 gap polar=25,
2831 radius={2.5}{2.7},
2832 slices end arrow={1}{-1},
2833 slices start arrow={1}{-1},
2834 slices style=Gray,
2835 total count=3
2836 ]{}
2837 \foreach\n in {-30,90,210}{
2838 \draw[->,MidnightBlue,ultra thick]
2839 (\n:1.7)--(\n:1.3);
2840 }
2841 \fill[
2842 top color=Gray!50,
2843 bottom color=Gray,
2844 draw,
2845 even odd rule
2846 ] (0,0) circle[radius=3.5]
2847 circle[radius=4.2];
2848 \wheelchart[
2849 arc{2}={
2850 <-,
2851 ultra thick
2852 },
2853 arc around text,
2854 arc data=~\WCvarA~,
2855 arc data pos=0.5,
2856 arc pos=0.5,
2857 data=,
2858 gap polar=10,
2859 radius={3.5}{4.2},
2860 slices style={fill=none},
2861 start half=180,
2862 value=1
2863 ]{
2864 {Mass M, Damping D, Stiffness K},
2865 Dynamic model,
2866 Frequency response functions H,
2867
2868 }
2869 \end{tikzpicture}
2870 \end{codeexample}
2871 \catcode`|=13%
2872 \section{Version history}
2873 \begin{itemize}
2874 \item[] \textbf{Version 1.0 (2022/09/11)} First version.
2875 \item[] \textbf{Version 2.0 (2023/12/03)}
2876 \begin{itemize}
2877 \item The package now mainly uses \LaTeX3 syntax.
2878 \item Improved the definition of the path of the slices.
2879 \item Many internal computations are now performed with |\fp_eval:n| instead of |pgfmath| for higher accuracy and to allow larger values. This applies in particular to the computation of |\WCpercentage|, |\WCpercentagerounded| and |\WCtotalnum|. Hence |\WCpercentagerounded| can be parsed by |siunitx| since its definition does not involve |\pgfmathprintnumberto| anymore and |\WCtotalnum| does not end with |.0| if it is an integer.
2880 \item The number of data which can be given to each slice of the wheelchart and accessed by |\WCvarA| and so on is not limited to $26$ anymore.
2881 \item \begin{flushleft}Added the macros |\WCcountdiscrete|, |\WCetocthelinkedname|, |\WCetocthelinkednumber|, |\WCetocthelinkedpage|, |\WCetocthename|, |\WCetocthenumber|, |\WCetocthenumberofpages|, |\WCetocthepage|, |\WClegend|, |\WClist|\meta{name} and |\|\meta{prefix}\meta{name}.\end{flushleft}
2882 \item \begin{flushleft}Added the keys |after slices|, |arc|, |arc around text|, |arc data|, |arc data align|, |arc data angle pos|, |arc data angle shift|, |arc data dir|, |arc data pos|, |arc data sep|, |arc data style|, |arc first half|, |arc pos|, |arc second half|, |arc sep|, |before slices|, |caption left sep|, |caption sep|, |data angle pos|, |data pos|, |discrete|, |discrete factor|, |discrete partitioning|, |discrete pic|, |discrete sort|, |discrete space at borders|, |domain|, |etoc code|, |etoc count total pages|, |etoc level|, |etoc name|, |etoc use name|, |expand list items|, |for loop end|, |for loop start|, |gap max angle|, |gap radius|, |header|, |header prefix|, |inner data angle pos|, |inner data angle shift|, |inner data pos|, |inner plot|, |inner plot style|, |legend columns|, |legend only|, |legend row|, |lines angle pos|, |lines angle shift|, |lines ext dir|, |lines ext fixed left|, |lines ext fixed right|, |lines pos|, |outer plot|, |outer plot style|, |parse|, |plot|, |plot style|, |samples|, |separator columns|, |separator rows|, |slices angle pos|, |slices angle shift|, |slices arc inner end|, |slices arc inner end start|, |slices arc inner start|, |slices arc inner start end|, |slices arc match|, |slices arc outer end|, |slices arc outer end start|, |slices arc outer start|, |slices arc outer start end|, |slices end to|, |slices inner angle reduce|, |slices inner angle shift|, |slices inner arc|, |slices inner arc tangent|, |slices inner arrow|, |slices inner end angle shift|, |slices inner start angle shift|, |slices inner to|, |slices outer angle reduce|, |slices outer angle shift|, |slices outer arc|, |slices outer arc tangent|, |slices outer arrow|, |slices outer end angle shift|, |slices outer start angle shift|, |slices outer to|, |slices pos|, |slices scope|, |slices sep|, |slices start to|, |slices to|, |slice|\marg{range}, |title left sep|, |title sep|, |triangle proportional area|, |triangle proportional height|, |WClist|\meta{name}, |wheel data angle pos|, |wheel data angle shift|, |wheel data sep|, |xbar| and |ybar|.\end{flushleft}
2883 \item Added the possibility to give a \meta{range} to the keys such that the options given to the key will only be applied to a slice if the number of the slice is in the \meta{range}.
2884 \item Added the possibility to give a \meta{list} to the keys.
2885 \item The \meta{wheelchart data} are not processed with |\foreach| anymore but instead with one of |\seq_set_split:Nee|, |\seq_set_split:Nen| or |\seq_set_split:Neo| depending on the keys |expand list| and |expand list items|. Thus syntax which is specific to how |\foreach| processes a list does not work anymore, such as the dots notation and the repeating of the last entry if some entry in the list has fewer entries than required.
2886 \item If the key |start angle| is set after the key |start half| then v1.0 preserved the setting of the key |start half|. In v2.0, the setting is determined by the key which is set last.
2887 \item In v1.0, the value of the key |data angle shift| was also applied to |inner data|, |lines| and |wheel data|. In v2.0, this is not the case anymore. Instead there are now separate keys |inner data angle shift|, |lines angle shift|, |wheel data angle shift| and also |arc data angle shift|.
2888 \item In v1.0, the key |data sep| was not applied if the key |lines ext| was used. In v2.0, this is not the case anymore.
2889 \item In v1.0, a negative value for the key |lines| was not applied. In v2.0, this is not the case anymore.
2890 \end{itemize}
2891 \item[] \textbf{Version 3.0 (2024/03/08)}
2892 \begin{itemize}
2893 \item Improved the parametrization of the slices in the case that no plot is used. In particular, the |arc| and |arc data| are placed with an arc if no plot is used whereas in v2.0, these were placed with a plot even if no plot was used. Also, the computation of |\WCdataangle| and |\WCmidangle| is more precise than in v2.0.
2894 \item Optimized the code. The compilation is faster than in v2.0.
2895 \item Added the commands |\WCangle|, |\WCcoordinate|, |\WCpoint| and |\WCradius|.
2896 \item \begin{flushleft}Added the keys |arc around line|, |arc data expand|, |arc data line sep factor|, |slices Arrow|, |slices end|, |slices inner|, |slices outer| and |slices start|.\end{flushleft}
2897 \item Changed the definition of |\WCperc| in the key |arc data| so that |\WCperc| follows the arc or plot.
2898 \item Added the possibility that the contents of the key |arc data| consists of multiple lines separated by |\\|.
2899 \item Reduced the functionality of the keys |contour| and |middle fill| to require a fixed inner and outer radius for all slices.
2900 \item Removed the key |parse|. The values of applicable keys are parsed with |\pgfmathparse|. If a value should be parsed with |l3fp| then |\fpeval| can be used.
2901 \item In v2.0, the key |arc data angle shift| was not taken into account for the key |arc| in combination with the key |arc around text|. This is fixed in v3.0.
2902 \item In v2.0, the number of items for each slice in the \meta{wheelchart data} which can be accessed with the macros |\WCvarA| and so on was determined by the number of items for the last slice. For example, |data{1}=\WCvarD| in combination with the \meta{wheelchart data} |1/black/A/a,2/gray/B| was not possible with v2.0. This is not a limitation anymore with v3.0.
2903 \end{itemize}
2904 \item[] \textbf{Version 4.0 (2024/07/28)}
2905 \begin{itemize}
2906 \item Added the keys |arc data lines pos| and |arc data lines shift|.
2907 \item Solved an incompatibility if |\\| is used in a key such as |data| inside an environment such as |center|.
2908 \end{itemize}
2909 \item[] \textbf{Version 5.0 (2025/07/24)}
2910 \begin{itemize}
2911 \item Replaced the deprecated |\regex_match:NVTF| by |\regex_if_match:NVTF|.
2912 \item If |\WClegend| is used in a |tblr| environment from the package |tabularray| then it is no longer necessary to give the option |expand=\WClegend| to this |tblr| environment.
2913 \end{itemize}
2914 \item[] \textbf{Version 6.0 (2026/04/19)} Cleaned up the documentation.
2915 \end{itemize}
2916 \begin{thebibliography}{9}
2917 \bibitem{JhcIparowcltopotPGFm}
2918 Jake,
2919 \emph{How can I produce a `ring (or wheel) chart' like that on page 88 of the {\upshape\pgfname} manual?},
2920 \url{https://tex.stackexchange.com/questions/17898/how-can-i-produce-a-ring-or-wheel-chart-like-that-on-page-88-of-the-pgf-manu/18105#18105},
2921 2011.
2922 \bibitem{MpMP}
2923 Jens-Uwe Morawski,
2924 \emph{{\upshape\texttt{piechart}\textsf{MP}}},
2925 Manual for Preliminary Version,
2926 \url{https://ctan.org/pkg/piechartmp},
2927 2002.
2928 \bibitem{RSVpaaMfp}
2929 Dominique Rodriguez, Michael Sharpe, Herbert Vo{\ss},
2930 \emph{{\upshape\texttt{pstricks-add} \textsf{additionals Macros for} \texttt{pstricks}}},
2931 Manual for version 3.94,
2932 \url{https://ctan.org/pkg/pstricks-add},
2933 2023.
2934 \bibitem{Ttdbdadm}
2935 Nicola L.C.~Talbot,
2936 \emph{The datatool Bundle: Databases and Data Manipulation},
2937 Manual for version 3.4.3,
2938 \url{https://ctan.org/pkg/datatool},
2939 2025.
2940 \bibitem{TtTaPGFp}
2941 Till Tantau,
2942 \emph{The \tikzname{} and {\upshape\pgfname} Packages},
2943 Manual for version 3.1.11a,
2944 \url{https://ctan.org/pkg/pgf},
2945 2025.
2946 \bibitem{XdPCbupp}
2947 Yuan Xu,
2948 \emph{Drawing Pie Chart by using {\upshape\texttt{pgf-pie}}},
2949 Manual for version 0.7,
2950 \url{https://ctan.org/pkg/pgf-pie},
2951 2022.
2952 \end{thebibliography}
2953 \clearpage
2954 \currentpdfbookmark{\indexname}{\indexname}
2955 \printindex
2956 \newgeometry{left=2.25cm,right=2.25cm,top=2.25cm,bottom=2.25cm}
2957 \pagestyle{plain}
2958 \appendix
2959 \addtocontents{toc}{\protect\setcounter{tocdepth}{-2}}
2960 \begin{landscape}
2961 \section{The source code}\label{Thesourcecode}
2962 \dochighinput[language=latex/latex3]{wheelchart.sty}
2963 \end{landscape}
2964 \end{document}