9. Skribilo User Manual — Pie Charts
Skribilo contains a pie-chart formatting package, located in the (skribilo package pie) module. It allows users to produces represent numeric data as pie charts as in the following example:
A default implementation, which uses Ploticus as an external program, is available for all engines. There is also a specific implementation for the Lout engine which relies on Lout's own pie-chart package. In the latter case, you don't need to have Ploticus installed, but you need it in the former.
Currently it only supports slice-coloring, but support for textures (particularly useful for black & white printouts) could be added in the future.
;; A sad pie chart. ;; (pie :title [Casualties in the Israel-Lebanon 2006 Conflict (source: English Wikipedia page, 2006-07-23)] :total 450 ;; to show the uncertainty on figures :ident "pie-lebanon-2006" :labels 'outside :fingers? #t (slice :weight 8 :color "black" [Hezbollah militants]) (slice :weight 42 :color "blue" [soldiers]) (slice :weight 317 :color "red" :detach? #t [civilians (,(sliceweight :percentage? #t)%)]))
This illustrates the three markups provided by the pie package, namely pie, slice, and sliceweight. This last markup returns the weight of the slice it is used in, be it as a percentage or an absolute value. Note that the :total option of pie can be used to create pie charts no entirely filled.
;; Another sad pie chart. ;; (pie :title [Casualties of the Conflict in Iraq since 2003 (source: English Wikipedia page, 2006-07-23)] :ident "pie-iraq-2006" :fingers? #f :labels 'inside :initial-angle 45 :radius 2 (slice :weight 100000 :color "red" :detach? #t [civilians (,(sliceweight :percentage? #t)%)]) (slice :weight (+ 2555 229) :color #xeeeeee [soldiers]))
The available markups and their options are described below.
3] [:total] [:initial-angle
"Pie Chart"] [:class
#f, the total that is used is the sum of the weight of each slice. html lout latex context info xml
outsideto have them appear outside of the pie,
insideto have them appear inside the pie, and
legendto have them appear in a separate legend. html lout latex context info xml
(slice [:detach?] [:color
labelThe label of the node. It can contain arbitrary markup, notably instances of
sliceweight. However, some engines, such as the Ploticus-based rendering, are not able to render markup other than
sliceweight; consequently, they render the label as though it were markup-free.
(sliceweight [:percentage?] [:class