Search Locate Previous Next Contents

ch.Pie – piecharts

Accepts a numeric vector or list of vectors and plots a piechart or trellis of small piecharts.

ch.Pie 6 4 3 1

Examples

BMAT„3 2½2 1 6 4 8 10
ch.Set('Style' 'Boxed')('Vmar' 6 0)('Hmar' 0)('Head' 'Pie;Chart')('Hstyle' 'left,bottom')
ch.Set('Xlab' 'UK and;Ireland,France,Spain,Norway,Greece,Italy')('Explode' 0 0 0 20)
ch.Pie(,BMAT)[”,BMAT]
PG„ch.Close

If you set X-labels (as above) or set the keys and use style ‘spider’, spider tags are used to arrange the labels radially around the pie.The data values will be appended to your labels if you set the ‘values’ style. To place the labels in a separate key, use ch.Set 'key' 'One,Two,Three' instead. You can also explode segments selectively or change the radius of each segment. Multi-line text is supported in the spider tags, but not in the key.

Plotting a collection of small pies
To plot a matrix of data as a collection of small pies, set up the headings as normal, and pass a simple numeric matrix with one row per pie. Alternatively you can pass a vector of numeric vectors, which may be convenient if the pies have different numbers of segments. By default, the cells in the trellis are used from left to right – to work down the columns set the trellis-style ‘snaking’ before making the pies.

In this case, the ‘xlabels’ will be used to label each small pie in the lower left corner using the subhead font and the keys are used as the spider tags (or a conventional key if you leave out this style).

See also ...
Piechart Style


Continue to: ch.Plot – line graphs
© Copyright Causeway Graphical Systems Ltd 2003