-
Notifications
You must be signed in to change notification settings - Fork 3
/
l3charts-doc.tex
969 lines (773 loc) · 24.2 KB
/
l3charts-doc.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
\documentclass{l3charts-doc}
\usepackage{l3charts}
% setup
\hypersetup{
keeppdfinfo,
pdftitle={l3charts},
pdfsubtitle={The LaTeX package},
pdfversionid=0.7.1,
pdfauthor={Éric BURGHARD},
pdfcontactemail={ctan@itsufficient.me},
pdfcontacturl={https://itsufficient.me},
pdfsubject={Customizable charts made with TikZ and LaTeX3},
pdfkeywords={LaTeX3, TikZ},
pdfcopyright={\textcopyright\ 2022 Éric BURGHARD\textLF
This work may be distributed and/or modified under the conditions
of the LaTeX Project Public License, either version 1.3c of this
license or (at your option) any later version.\textLF
This work has the LPPL maintenance status `maintained'.},
pdflicenseurl={https://www.latex-project.org/lppl/},
pdflang={en-GB}
}
% bold with appended %
\NewDocumentCommand\textbfp{m}{\textbf{\percent{#1}}}
% format label white on black
\NewDocumentCommand\textinv{m}{\colorbox{black}{\textcolor{white}{#1}}}
% bold red
\NewDocumentCommand\redbf{m}{\textcolor{red!50}{\textbf{#1}}}
\NewDocumentCommand\redbfp{m}{\textcolor{red!50}{\textbfp{#1}}}
% bold white
\NewDocumentCommand\whitebf{m}{\textcolor{white}{\textbf{#1}}}
\NewDocumentCommand\whitebfp{m}{\textcolor{white}{\textbfp{#1}}}
% tenth rate
\ExplSyntaxOn
\NewDocumentCommand\tenrate{m}{\int_eval:n{#1/10}/10}
\ExplSyntaxOff
% Start document
\RecordChanges
\PageIndex
\title{The \texttt{l3charts} package}
\author{Éric BURGHARD}
\date{2023/01/04}
\def\githuburl{https://git.itsufficient.me/latex/l3charts}
\begin{document}
\newgeometry{scale={0.8,0.9},top=2cm} % title page is centered
\maketitle
\thispagestyle{empty}
\begin{abstract}
This package defines a few simple \TikZ{} charts that can be drawn using \LaTeX{}
environments. This has mainly been developed as an experimentation of \texttt{expl3} for
checking what \LaTeX3 really brought to facilitate package development (expansion control,
\texttt{seq}, \texttt{prop},\texttt{ keys},\texttt{ int},\texttt{ bool},\texttt{ fp},\texttt{
dim},\texttt{msg}, ...).
\end{abstract}
\tableofcontents
\newpage
\restoregeometry% restore default geometry
\section{About this documentation}
I doubt that \LaTeX{} will have one day a modern documentation system as powerful as \href{https://doc.rust-lang.org/cargo/commands/cargo-doc.html}{\texttt{cargo doc}} due to its
typeless and syntaxless nature. In my opinion \LaTeX{} literate programming with \pkg{docstrip}
is just an ugly hack that turns the code and the documentation unmaintainable, and it's probably
the component of \LaTeX{} which aged the most.
So I chose to write the documentation separately and borrowed much of the style from the
\href{https://github.com/schlcht/microtype}{\pkg{microtype}} package which by the way (if you
are still curious about it), pushes the \pkg{docstrip} mastery to a \emph{black magic} level.
\section{Motivation}
This package has been developed mainly to typeset a fancy résumé but perhaps it could be
used in other contexts too. I didn't want to write \TikZ{} charts directly in the document
as it would have turned a simple typesetting file into an unreadable document, and I would have
forgotten every details after just a few months.
I wouldn't have the patience to develop this with \LaTeX{} or \TeX{} either, but I was curious
enough about \pkg{expl3} to try an implementation. You should probably take this package as a rough
tutorial on how to develop with \pkg{expl3} because it uses nearly all the types defined in the
reference documentation (expansion control, \texttt{seq},\texttt{ prop},\texttt{ keys},\texttt{
int},\texttt{ bool},\texttt{ fp},\texttt{ dim},\texttt{ msg}, ...) in straightforward ways.
\TeX{} will always be that dusty tech you can't ignore because but there are so many (unmatched)
packages coming from academic circles, but \pkg{expl3} gives a touch of modernity and facilitates
a lot package development by allowing to easily bridge \TeX{} packages (here \LaTeX{} and \TikZ).
\section{Kiviat chart}
\subsection{Usage}
The \href{https://en.wikipedia.org/wiki/Radar_chart}{kiviat chart} or \emph{radar chart} allows
to represent one or several set along several dimensions.
\DescribeEnv{kiviatchart}
Environment that hold a kiviat chart. Accepts an optional argument \oarg{clist} which
is comma separated list of keywords and values :
\Describe{Option}{radius}{:dim}[3.5cm]
Maximal diagram radius
\Describe{Option}{units}{:int}[5]
Set the scale of units from 0 to the given number
\Describe{Option}{rounded}{:bool}[false]
Use circles for the scale and curves for the sets instead of polygons
\Describe{Option}{*}{:keyval}
All other options are passed to \env{tikzpicture}
A \env{kiviatchart} should begin with a \env{dims}, followed by one or several \env{set}.
\subsubsection{Dimensions}
\DescribeEnv{dims}
Environment that hold the definition of all dimensions. Accepts an optional argument \oarg{clist}
which is comma separated list of keywords and values :
\Describe{Option}{radius}{:dim}[\env{kiviatchart} \opt{radius}]
Radius to put dimension labels on
\Describe{Option}{label-on}{:int}[1]
Dimension axis index (between 1 and number of dimensions) to put the labels on. In case of
invalid value (0), the units labels are hidden.
\Describe{Option}{dim-options}{:prop}[\{opacity=0.8\}]
\TikZ{} options for drawing dimensions axis with
\Describe{Option}{unit-options}{:prop}[\{opacity=0.3\}]
\TikZ{} options for drawing unit polygons with
\Describe{Option}{label-options}{:prop}[\{opacity=0.5,above,xshift=1.5mm\}]
\TikZ{} options drawing for unit labels
\Describe{Option}{label-cs}{:str}[identity]
Name of the cs used to format labels
\Describe{Option}{unit-cs}{:str}[tinytt]
Name of the cs used to format unit scale
\Describe{Option}{angle}{:fp}[90]
Angle of the first dimension
\DescribeMacro{value}
\cs{value}\oarg{clist}\marg{label} is used to add a dimension to the kiviat chart. \oarg{clist} is
passed to \TikZ{} to draw the nodes corresponding to the labels.
\subsubsection{Set}
\DescribeEnv{set}
\env{set} is used to add a new set to the kiviat chart. Accepts an optional argument \oarg{clist}
which is comma separated list of keywords and values :
\Describe{Option}{dot-options}{:prop}[\{fill,circle,inner~sep=1pt\}]
Options for polygon node
\Describe{Option}{*}{:keyval}[color=black,line~width=1.5pt,opacity=1,fill~opacity=0.3,fill=gray]
All other options are passed to \cs{draw} cs which draws the polygon
\DescribeMacro{value}
\cs{value}\marg{int} is used to add a value to the set.
There must be the same number of \cs{value} inside \env{set} and \env{dims}, and each \cs{value}
corresponds to the dimension in \env{dims} at the same index.
\newpage
\subsection{Examples}
\subsubsection{Simple}
\begin{example}
% scale is passed to tikzpicture
\begin{kiviatchart}[scale=0.75]
% Define the dimensions
\begin{dims}[
% inverted labels
label-cs=textinv,
% value scale on dim2 axis
label-on=2]
% Specify placement of each
% labels
\value[above]{Dim 1}
\value[right]{Dim 2}
\value[below]{Dim 3}
\value[below]{Dim 4}
\value[left]{Dim 5}
\end{dims}
% Add least one set should
% be defined.
\begin{set}
\value{4} % Dim 1
\value{3} % Dim 2
\value{4} % Dim 3
\value{5} % Dim 4
\value{3} % Dim 5
\end{set}
\end{kiviatchart}
\end{example}
\subsubsection{Rounded}
\begin{example}
% rounded replace polygons by circles
% curves
\begin{kiviatchart}[
scale=0.75,
rounded]
% Define the dimensions
\begin{dims}[
% inverted labels
label-cs=textinv,
% value scale on dim2 axis
label-on=2]
% Specify placement of each
% labels
\value[above]{Dim 1}
\value[right]{Dim 2}
\value[below]{Dim 3}
\value[below left]{Dim 4}
\value[left]{Dim 5}
\end{dims}
% Add least one set should
% be defined.
\begin{set}
\value{4} % Dim 1
\value{3} % Dim 2
\value{4} % Dim 3
\value{5} % Dim 4
\value{3} % Dim 5
\end{set}
\end{kiviatchart}
\end{example}
\subsubsection{Multi-set}
\begin{example}
\begin{kiviatchart}[
scale=0.75,
rounded]
\begin{dims}[
% bigger radius for labels
radius=3.7cm,
% hide unit labels
label-on=0]
\value[above]{Dim 1}
\value[right]{Dim 2}
\value[below]{Dim 3}
\value[below]{Dim 4}
\value[left]{Dim 5}
\end{dims}
\begin{set}[% red set
fill=red,
% big rectangle dots
dot-options={
fill,rectangle,
inner sep=2pt
}]
\value{4} % Dim 1
\value{3} % Dim 2
\value{4} % Dim 3
\value{5} % Dim 4
\value{2} % Dim 5
\end{set}
\begin{set}[% green set
fill=green,
% big diamond dots
dot-options={
fill,diamond,
inner sep=2pt
}]
\value{2} % Dim 1
\value{4} % Dim 2
\value{3} % Dim 3
\value{4} % Dim 4
\value{5} % Dim 5
\end{set}
\begin{set}[% blue set
fill=blue,
% big semicircle dots
dot-options={
fill,semicircle,
inner sep=2pt
}]
\value{5} % Dim 1
\value{2} % Dim 2
\value{4} % Dim 3
\value{3} % Dim 4
\value{4} % Dim 5
\end{set}
\end{kiviatchart}
\end{example}
\subsection{To do}
At the moment the environments are not user friendly. We could provide basic sanity checks,
with error messages when theses rules are violated :
\begin{itemize}
\item one and only one \env{dims} declared before any \env{set}
\item at least 3 dimensions are declared
\item all \env{set} have the same number of \cs{value} than the \env{dims}
\item \cs{value} in \env{set} is between 0 and \key{units}
\end{itemize}
\section{Ball chart}
\subsection{Usage}
\DescribeEnv{ballchart}
Environment that hold a ball chart. Accepts an optional argument \oarg{clist} which is comma
separated list of keywords and values :
\Describe{Option}{n}{:int}[5]
The number of circles per bar
\Describe{Option}{gap}{:dim}[1ex]
Gap between bars
\Describe{Option}{cgap}{:dim}[1pt]
Gap between circles
\Describe{Option}{radius}{:dim}[2.5mm]
Radius of the circles
\Describe{Option}{label-cs}{:str}[identity]
Macro name to format labels
\Describe{Option}{fill-options}{:prop}[\{fill=black\}]
\TikZ{} options to fill the balls with
\Describe{Option}{draw-options}{:prop}[\{draw=none\}]
\TikZ{} options to draw the balls with
\Describe{Option}{label-options}{:prop}[\{left\}]
\TikZ{} options for dimensions axis
\Describe{Option}{label-cs}{:str}[identity]
Macro name to format labels
\Describe{Option}{label-pos}{:str}[left]
Position of the label. Possible values :
\begin{itemize}
\item \texttt{left}, \texttt{right}
\item \texttt{above}, \texttt{below}
\item \texttt{above right}, \texttt{above left}
\item \texttt{below right}, \texttt{below left}
\end{itemize}
\Describe{Option}{value-cs}{:str}[nop]
cs name to format values with
\Describe{Option}{*}{:keyval}
All other options are passed to \env{tikzpicture}
\DescribeMacro{value}
\cs{value}\marg{label}\marg{percent} is used to add a new bar.
\subsection{Examples}
\subsubsection{Simple}
\begin{example}
\begin{ballchart}
\value{Dim 1}{95}
\value{Dim 2}{80}
\value{Dim 3}{80}
\value{Dim 4}{20}
\end{ballchart}
\end{example}
\begin{example}
\begin{ballchart}[
% inverted labels
label-cs=textinv,
% to the right
label-pos=right,
% closer to the bar
label-options={xshift=-8mm},
% show circle
draw-options={draw=black!30}]
\value{Dim 1}{95}
\value{Dim 2}{80}
\value{Dim 3}{80}
\value{Dim 4}{20}
\end{ballchart}
\end{example}
\subsubsection{Delimited}
\begin{example}
\begin{ballchart}[
% 6 circles per bar
n=6,
% red labels
label-cs=redbf,
% closer to bar
label-options={xshift=4mm},
% bigger gap
gap=1.5ex,
cgap=3pt,
% fill in red
fill-options={fill=red!50},
% black circle
draw-options={draw=black}]
\value{Dim 1}{95}
\value{Dim 2}{80}
\value{Dim 3}{80}
\value{Dim 4}{20}
\end{ballchart}
\end{example}
\section{Bar chart}
\subsection{Usage}
\DescribeEnv{barchart}
Environment that hold a bar chart. Accepts an optional argument \oarg{clist} which is comma
separated list of keywords and values :
\Describe{Option}{width}{:dim}[3cm]
Maximum width
\Describe{Option}{height}{:dim}[3.5mm]
Bar height
\Describe{Option}{gap}{:dim}[1ex]
Gap between bars
\Describe{Option}{fill-options}{:prop}[\{fill=none\}]
\TikZ{} options to fill the bar with
\Describe{Option}{draw-options}{:prop}[\{fill=black\}]
\TikZ{} options to draw the bar with
\Describe{Option}{label-options}{:prop}[\{\}]
\TikZ{} options for dimensions axis
\Describe{Option}{label-cs}{:str}[identity]
Macro name to format labels
\Describe{Option}{label-pos}{:str}[left]
Position of the label. Possible values :
\begin{itemize}
\item \texttt{left}, \texttt{right}
\item \texttt{above}, \texttt{below}
\item \texttt{above right}, \texttt{above left}
\item \texttt{below right}, \texttt{below left}
\end{itemize}
\Describe{Option}{value-cs}{:str}[nop]
cs name to format values with
\Describe{Option}{*}{:keyval}
All other options are passed to \env{tikzpicture}
\DescribeMacro{value}
\cs{value}\marg{label}\marg{percent} is used to add a new bar.
\subsection{Examples}
\subsubsection{Simple}
\begin{example}
\begin{barchart}
\value{Dim 1}{60}
\value{Dim 2}{100}
\value{Dim 3}{70}
\value{Dim 4}{70}
\value{Dim 5}{40}
\value{Dim 6}{60}
\end{barchart}
\end{example}
\begin{example}
\begin{barchart}[
% inverted labels
label-cs=textinv,
% to the right
label-pos=right,
% closer to bar
label-options={xshift=-8mm}]
\value{Dim 1}{60}
\value{Dim 2}{100}
\value{Dim 3}{70}
\value{Dim 4}{70}
\value{Dim 5}{40}
\value{Dim 6}{60}
\end{barchart}
\end{example}
\subsubsection{Gauge}
\begin{example}
\begin{barchart}[
% 4cm wide bars
width=4cm,
% inverted labels
label-cs=redbf,
% closer to bar
label-options={xshift=4mm},
% show values
value-cs=whitebfp,
% bigger gap
gap=1.5ex,
% bar in red
draw-options={
draw=red!50,
fill=red!50},
% show borders in red
fill-options={
fill=red!30,
draw=red!30}]
\value{Dim 1}{60}
\value{Dim 2}{100}
\value{Dim 3}{70}
\value{Dim 4}{70}
\value{Dim 5}{40}
\value{Dim 6}{60}
\end{barchart}
\end{example}
\section{Bubble chart}
\subsection{Usage}
\DescribeEnv{bubblechart}
Environment that hold a bubble chart. Accepts an optional argument \oarg{clist} which
is comma separated list of keywords and values :
\Describe{Option}{radius}{:dim}[1cm]
Max radius
\Describe{Option}{gap}{:dim}[1ex]
Gap between bubbles
\Describe{Option}{fill-options}{:prop}[\{fill=none,draw=none\}]
\TikZ{} options to fill/draw the background with
\Describe{Option}{draw-options}{:prop}[\{fill=black\}]
\TikZ{} options to fill/draw the bubble with
\Describe{Option}{label-cs}{:str}[identity]
Macro name to format labels
\Describe{Option}{label-pos}{:str}[above]
Position of the label. Possible values :
\begin{itemize}
\item \texttt{left}, \texttt{right}
\item \texttt{above}, \texttt{below}
\item \texttt{above right}, \texttt{above left}
\item \texttt{below right}, \texttt{below left}
\end{itemize}
\Describe{Option}{value-cs}{:str}[nop]
cs name to format values with
\Describe{Option}{vertical}{:bool}[false]
Stack the bubble vertically instead of horizontally
\Describe{Option}{*}{:keyval}
All other options are passed to \env{tikzpicture}
\DescribeMacro{value}
\cs{value}\marg{label}\marg{percent} is used to add a new bubble.
\subsection{Examples}
\subsubsection{Horizontal}
\begin{example}
\begin{bubblechart}
\value{Dim 1}{80}
\value{Dim 2}{90}
\value{Dim 3}{50}
\end{bubblechart}
\end{example}
\begin{example}
\begin{bubblechart}[
% inverted labels
label-cs=textinv,
% below bubble
label-pos=below,
% show borders
fill-options={
fill=none,
draw=black!30}]
\value{Dim 1}{80}
\value{Dim 2}{90}
\value{Dim 3}{50}
\end{bubblechart}
\end{example}
\begin{example}
\begin{bubblechart}[
% label in red
label-cs=redbf,
% below bubble
label-pos=below,
% show value
value-cs=whitebfp,
% bubble in red
draw-options={
draw=red!50,
fill=red!50},
% background in light red
fill-options={
fill=red!10}]
\value{Dim 1}{80}
\value{Dim 2}{90}
\value{Dim 3}{50}
\end{bubblechart}
\end{example}
\subsubsection{Vertical}
\begin{example}
\begin{bubblechart}[
% stack bubbles vertically
vertical,
% label in bold
label-cs=textbf,
% show values
value-cs=whitebfp,
% to the right
label-pos=right,
% show max as dotted line
fill-options={
fill=none,
draw=black,
dotted}]
\value{Dim 1}{80}
\value{Dim 2}{90}
\value{Dim 3}{50}
\end{bubblechart}
\end{example}
\section{Radial chart}
\subsection{Usage}
\DescribeEnv{radialchart}
Environment that hold a radial chart. Accepts an optional argument \oarg{clist} which
is comma separated list of keywords and values :
\Describe{Option}{radius}{:dim}[1cm]
Max radius
\Describe{Option}{gap}{:dim}[2.5ex]
Gap between radials
\Describe{Option}{line width}{:dim}[3mm]
Line width to draw the radials with
\Describe{Option}{fill-options}{:prop}[\{fill=none,draw=black!10\}]
\TikZ{} options to fill/draw the center of the radial with
\Describe{Option}{draw-options}{:prop}[black]
\TikZ{} options to draw the radial with
\Describe{Option}{label-options}{:prop}[\{\}]
\TikZ{} options drawing for unit labels
\Describe{Option}{label-cs}{:str}[identity]
cs name to format labels with
\Describe{Option}{label-pos}{:str}[above]
Position of the label. Possible values :
\begin{itemize}
\item \texttt{left}, \texttt{right}
\item \texttt{above}, \texttt{below}
\item \texttt{above right}, \texttt{above left}
\item \texttt{below right}, \texttt{below left}
\end{itemize}
\Describe{Option}{value-cs}{:str}[identity]
cs name to format values with
\Describe{Option}{vertical}{:bool}[false]
Stack radials vertically instead of horizontally
\Describe{Option}{*}{:keyval}[line cap=round]
All other options are passed to \env{tikzpicture}
\subsection{Examples}
\subsubsection{Horizontal}
\begin{example}
\begin{radialchart}
\value{Dim 1}{80}
\value{Dim 2}{90}
\value{Dim 3}{50}
\end{radialchart}
\end{example}
\begin{example}
\begin{radialchart}[
% inverted label,
label-cs=textinv,
% below radial,
label-pos=below,
% in red bold.
value-cs=redbfp,
% ring is red
draw-options={red!50},
% disk is light red
fill-options={
fill=red!10}]
\value{Dim 1}{80}
\value{Dim 2}{90}
\value{Dim 3}{50}
\end{radialchart}
\end{example}
\subsubsection{Vertical}
\begin{example}
\begin{radialchart}[
% stack radials vertically
vertical,
% label as tenth fraction
value-cs=tenrate,
% to the right
label-pos=right,
% thicker line
line width=3.5mm,
% with rect end
line cap=butt,
% same color for disk and ring
fill-options={
draw=black!10,
fill=black!10}]
\value{Dim 1}{80}
\value{Dim 2}{90}
\value{Dim 3}{50}
\end{radialchart}
\end{example}
\section{Arc chart}
\subsection{Usage}
\DescribeEnv{arcchart}
Environment that hold an arc chart. Accepts an optional argument \oarg{clist} which
is comma separated list of keywords and values :
\Describe{Option}{radius}{:dim}[1cm]
Radius of outer arc
\Describe{Option}{gap}{:dim}[2.5ex]
Gap between arcs
\Describe{Option}{line width}{:dim}[4mm]
Line width to draw the arc with
\Describe{Option}{fill-options}{:prop}[\{fill=none,draw=black!10\}]
\TikZ{} options to fill/draw the background of the arcs with
\Describe{Option}{draw-options}{:prop}[black]
\TikZ{} options to draw the arcs with
\Describe{Option}{label-options}{:prop}[\{\}]
\TikZ{} options drawing for unit labels
\Describe{Option}{label-cs}{:str}[identity]
cs name to format labels with
\Describe{Option}{value-options}{:prop}[{}]
\TikZ{} options to draw values with
\Describe{Option}{value-cs}{:str}[nop]
cs name to format values with
\Describe{Option}{value-angle}{:fp}[90]
Angle at which to draw the values
\Describe{Option}{*}{:keyval}[line cap=round]
All other options are passed to \env{tikzpicture}
\subsection{Examples}
\subsubsection{Simple}
\begin{example}
\begin{arcchart}
\value{Dim 1}{100}
\value{Dim 2}{90}
\value{Dim 3}{60}
\value{Dim 4}{45}
\end{arcchart}
\end{example}
\subsubsection{Colorful}
\begin{example}
\begin{arcchart}[
% bigger radius,
radius=2.5cm,
% and gap
gap=1.5mm,
% show values
value-cs=whitebf,
% at 30°
value-angle=30,
% thicker line width,
line width=4.5mm,
% with square end
line cap=butt]
% each ring has its own color
\value[blue!50]{Dim 1}{100}
\value[cyan!50]{Dim 2}{90}
\value[purple!50]{Dim 3}{60}
\value[red!50]{Dim 4}{45}
\end{arcchart}
\end{example}
\section{Macros}
\subsection{Package}
These are macros defined in \pkg{l3charts.sty} and used as default value for \opt{label-cs}
or \opt{value-cs} options.
\DescribeMacro{tinytt}
Macro used to format its argument as tiny monospace
\begin{minted}{latex}
\cs_set:Npn \tinytt #1 {\texttt{\tiny #1}}
\end{minted}
\DescribeMacro{identity}
Macro used to return the first argument as is
\begin{minted}{latex}
\cs_set:Npn \identity #1 {#1}
\end{minted}
\DescribeMacro{nop}
Macro used to consume the first argument and do nothing
\begin{minted}{latex}
\cs_set:Npn \nop #1 {}
\end{minted}
\DescribeMacro{percent}
Macro used to append a percent to its argument
\begin{minted}{latex}
\cs_set:Npn \percent #1 {#1\%}
\end{minted}
\subsection{Examples}
These macros are defined for the examples presented in this document and are not part of
the module \pkg{l3charts.sty}.
\DescribeMacro{textbfp}
Macro used to format its argument as bold with appended \%
\begin{minted}{latex}
\NewDocumentCommand\textbfp{m}{\textbf{\percent{#1}}}
\end{minted}
\DescribeMacro{tenrate}
Macro used to format its argument as fraction of ten
\begin{minted}{latex}
\ExplSyntaxOn
\NewDocumentCommand\tenrate{m}{\int_eval:n{#1/10}/10}
\ExplSyntaxOff
\end{minted}
\DescribeMacro{textinv}
Macro used to format its argument as white text on black background
\begin{minted}{latex}
\NewDocumentCommand\textinv{m}{\colorbox{black}{\textcolor{white}{#1}}}
\end{minted}
\DescribeMacro{redbf}
Macro used to format its argument as bold and red
\begin{minted}{latex}
\NewDocumentCommand\redbf{m}{\textcolor{red!50}{\textbf{#1}}}
\end{minted}
\DescribeMacro{redbfp}
Macro used to format its argument as bold and red with appended \%
\begin{minted}{latex}
\NewDocumentCommand\redbfp{m}{\textcolor{red!50}{\textbfp{#1}}}
\end{minted}
\DescribeMacro{whitebf}
Macro used to format its argument as bold and white
\begin{minted}{latex}
\NewDocumentCommand\whitebf{m}{\textcolor{white}{\textbf{#1}}}
\end{minted}
\DescribeMacro{whitebfp}
Macro used to format its argument as bold and white with appended \%
\begin{minted}{latex}
\NewDocumentCommand\whitebfp{m}{\textcolor{white}{\textbfp{#1}}}
\end{minted}
% \newpage
\PrintIndex
\section{Changes}
\begin{History}
\Version{0.7.1}{2023/01/04}
\item add a \opt{rounded} option to \env{kiviatchart} to use circles for the scale and curves
for the sets.
\Version{0.7.0}{2022/08/01}
\item add a \env{arcchart}
\item rename \opt{line-width} to \opt{line width} for consistency with \TikZ
\item use choice to restrict values on \opt{label-pos}
\item remove spurious ; and replace \texttt{c\_space\_tl} by \textasciitilde
\Version{0.6.1}{2022/07/26}
\item add a \opt{label-on} option for \env{dims} of \env{kiviatchart}
\Version{0.6.0}{2022/07/26}
\item draw \env{kiviatchart} dimensions clockwise with a starting \opt{angle} of 90
\item allow value of 0 for \env{set}
\item rename \opt{labels-radius} to \opt{radius} and move to \env{dims}
\Version{0.5.1}{2022/07/19}
\item remove hard coded \% in value.
\Version{0.5.0}{2022/07/18}
\item convert all \type{fp} to \type{dim} for usability
\item rename \opt{v-sep} and \opt{h-sep} options of \env{ballchart} to \opt{gap} and \opt{cgap}
for consistency
\Version{0.4.0}{2022/07/17}
\item add values to \env{bubblechart}
\item label positioning on \env{barchart} and \env{ballchart}
\item swap \opt{fill-options} and \opt{draw-options} for \env{barchart} for consistency
\Version{0.3.0}{2022/07/15}
\item add a \env{radialchart} to draw radials
\item add a vertical mode to \env{bubblechart} and allow positioning of the label
\item swap \opt{fill-options} and \opt{draw-options} for \env{bubblechart} for consistency
\Version{0.2.0}{2022/07/04}
\item define a document class borrowed from
\href{https://github.com/schlcht/microtype}{\pkg{microtype}}
\Version{0.1.0}{2022/07/01}
\item Initial version
\end{History}
\end{document}