DPIE directive

Draws a pie chart on a plotter or graphics monitor.


Options

TITLE = text
General title; default *

WINDOW = scalar
Window number for the pie chart; default 1

KEYWINDOW = scalar
Window number for the key (zero for no key); default 2

ANNOTATION = string
How to annotate each slice (description, percentage); default desc, perc

OUTLINE = string
Where to draw outlines (slices, perimeter); default slices

PENOUTLINE = scalar
Pen to use for the outlines; default -10

SCREEN = string
Whether to clear the screen before plotting or to continue plotting on the old screen (clear, keep); default clea

KEYDESCRIPTION = text
Overall description for the key

ENDACTION = string
Action to be taken after completing the plot (continue, pause); default * uses the setting from the last DEVICE statement


Parameters

SLICE = scalars
Amounts in each of the slices (or categories)

PEN = scalars
Pen number for each slice; default * uses pens 1, 2, and so on for the successive slices

DESCRIPTION = texts
Description of each slice


Description

A pie chart is formed by taking the values of the scalars in the SLICE parameter, in order, and representing them by segments of a circle starting at "three o'clock" and working in an anti-clockwise direction. The angle subtended by each segment (and thus the area of the segment) is proportional to the value of the corresponding scalar. The values may be raw data or can be expressed as percentages (by ensuring they total 100).

   The brush style used for each segment can be controlled using the PEN parameter. By default, pen 1 is used for the first segment, pen 2 for the second segment, and so on. The default attributes of the pens are device specific, so that on a colour display the segments will be solid-filled using different colours, and on a monochrome device different hatching styles will be used. These can be modified using the PEN directive.

   Individual segments can be displaced outwards from the centre, to obtain an "exploded" pie chart. The chosen segments are indicated by setting the corresponding scalars in the SLICE parameter list to negative values.

   The WINDOW and KEYWINDOW options specify the windows in which the pie chart and key are to be displayed. The shape of the pie chart is determined by the dimensions of the window; if it is not square the resulting pie chart will be elliptical.

   Titles can be added using the TITLE and KEYDESCRIPTION options. The key produced for the pie chart is similar to that produced by the DHISTOGRAM directive. A shaded block is drawn for each segment, followed by the annotation requested using the settings of the ANNOTATION option:

    description
the text supplied by the DESCRIPTION parameter or, if this is not set, the identifier of the SLICE scalar;

    percentage
the percentage contained in the slice.

   The OUTLINE option controls whether lines are drawn around the slices or around the perimeter of the pie chart. These are drawn using the pen specified by the PENOUTLINE option (default -10). You can suppress all the outlines by setting OUTLINE=*.

   The SCREEN option controls whether the graphical display is cleared before the histogram is plotted and the ENDACTION option controls whether GenStat pauses at the end of the plot.

 

Options: TITLE, WINDOW, KEYWINDOW, ANNOTATION, OUTLINE, PENOUTLINE, SCREEN, KEYDESCRIPTION, ENDACTION.

Parameters: SLICE, PEN, DESCRIPTION.


See also

Directives: BARCHART, DHISTOGRAM, D3HISTOGRAM, LPHISTOGRAM, FRAME, XAXIS, YAXIS, PEN.

Procedures: TRELLIS, DBARCHART, DOTHISTOGRAM, DOTPLOT, DCIRCULAR, WINDROSE.