9. Skribilo User Manual — Pie Charts
Contents↑ Skribilo User Manual

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:

Use of Document Formatting Systems
Use of Document Formatting Systems

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.

9.1 Syntax

Let us start with a simple example:

Ex. 39: Example of a pie chart

... produces:

Casualties in the Israel-Lebanon 2006 Conflict (source: English Wikipedia page, 2006-07-23)
Casualties in the Israel-Lebanon 2006 Conflict (source:
English Wikipedia page, 2006-07-23)

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.

Various options allow the pie layout to be controlled:

Ex. 40: Specifying the layout of a pie chart

... produces:

Casualties of the Conflict in Iraq since 2003 (source: English Wikipedia page, 2006-07-23)
Casualties of the Conflict in Iraq since 2003 (source:
English Wikipedia page, 2006-07-23)

The available markups and their options are described below.

(pie [:labels 'outside] [:fingers? #t] [:radius 3] [:total] [:initial-angle 0] [:title "Pie Chart"] [:class "pie"] [:ident])
:ident The node identifier. html lout latex context info xml
:class The node class. html lout latex context info xml
:title The title of the pie chart. html lout latex context info xml
:initial-angle The initial angle of the pie, in degrees. html lout latex context info xml
:total If a number, specifies the "weight" of the whole pie; in this case, if the pie's slices don't add up to that number, then part of the pie is shown as empty. If #f, the total that is used is the sum of the weight of each slice. html lout latex context info xml
:radius The pie's radius. How this value is interpreted depends on the engine used. html lout latex context info xml
:fingers? Indicates whether to add "fingers" (arrows) from labels to slices when labels are outside of slices. lout
:labels A symbol indicating where slice labels are rendered: outside to have them appear outside of the pie, inside to have them appear inside the pie, and legend to have them appear in a separate legend. html lout latex context info xml
See also slice .
(slice [:detach?] [:color "white"] [:weight 1] [:class "pie-slice"] [:ident] label)
:ident The node identifier. html lout latex context info xml
:class The node class. html lout latex context info xml
:weight An integer indicating the weight of this slice. html lout latex context info xml
:color The background color of the slice. html lout latex context info xml
:detach? Indicates whether the slice should be detached from the pie. html lout latex context info xml
label The 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.
See also pie , sliceweight .

As seen in the examples above, the body of a slice markup can contain instances of sliceweight to represent the weight of the slice:

(sliceweight [:percentage?] [:class "pie-sliceweight"] [:ident])
:ident The node identifier. html lout latex context info xml
:class The node class. html lout latex context info xml
:percentage? Indicates whether the slice's weight should be shown as a percentage of the total pie weight or as a raw weight. html lout latex context info xml
See also slice .
(made with skribilo)