Draws a pie chart on a plotter or graphics monitor.
||General title; default
||Window number for the pie chart; default 1|
||Window number for the key (zero for no key); default 2|
||How to annotate each slice (
||Where to draw outlines (
||Pen to use for the outlines; default -10|
||Whether to clear the screen before plotting or to continue plotting on the old screen (
||Overall description for the key|
||Action to be taken after completing the plot (
||Amounts in each of the slices (or categories)|
||Pen number for each slice; default
||Description of each slice|
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 colour 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 colours differ from pen to pen and can be modified using the
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.
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
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
||the text supplied by the
||the percentage contained in the slice.|
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
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.
" Example DPIE-1: Draw a pie chart" VARIATE [VALUES=1,1.1,1.2,1.3] Amount " DPIE requires a series of numbers rather than a variate, so substitute the contents of the variate with the # symbol." DPIE [TITLE='Pie Chart'] #Amount " Draw another, with one section exploded." PEN 1...5; BRUSH=12,13,9,8,2 DPIE [TITLE='Exploded Pie Chart'] 23,22,-31,10,4; PEN=1...5;\ DESCRIPTION='Apples','Pears','Oranges','Bananas','Peaches'