#set TITLE = "proc pie"
#include top
 
.ig >>
<center>
<img src="../gallery/pie0.gif">
</center>
.>>

.SH DESCRIPTION
Display a pie graph.
Values will be displayed as a proportion of the sum, unless
the \fCtotal\fR attribute is specified.

.SH FEATURES
Automatic labeling in several different modes.
.LP
Exploding of one slice, selected slices or all slices.
.LP
Single color or multiple colors.

.SH EXAMPLES
See the Gallery Pie page
.ig >>
<a href="../gallery/gall.pie.html"><img src="../gallery/btn/here.gif"></a>
.>>

.SH UNPLOTTABLE DATA 
\fBproc pie\fR will omit data points that are not valid
or not within the plotting area.

.SH PREREQUISITES
\fBproc getdata\fR must have been invoked to access or define some data.
A plotting area does not need to be set up (using \fBproc areadef\fR),
unless locations, lengths, etc. are to be specified in scaled units.


.SH MANDATORY ATTRIBUTES
.LP
The \fCdatafield\fR, \fCcenter\fR, and \fCradius\fR attributes
MUST be specified.

.SH ATTRIBUTES
.LP
\fBdatafield\fR
.ig >>
<a href="attributetypes.html#datafield">
.>>
\fI dfield \fR
.ig >>
</a>
.>>
.IP
The field to get the values from.

.LP
\fBcenter\fR
.ig >>
<a href="attributetypes.html#xy">
.>>
\fI x y \fR
.ig >>
</a>
.>>
.IP
Location of the center of the pie.
Example: \fCcenter: 3 5.6\fR

.LP
\fBradius\fR
.ig >>
<a href="attributetypes.html#lenvalue">
.>>
\fI lenvalue \fR
.ig >>
</a>
.>>
.IP
Radius of the pie.
Example: \fCradius: 1.5\fR

.LP
\fBfirstslice\fR \fIn\fR
.IP
Controls where, in degrees, that the first slice will be displayed.
Default is 0 (the top).  90 corresponds to the three o'clock position.
Slices are displayed in clockwise order.
This may be useful to control where to slices fall, or to work around
a label collision problem.
.br
Example: \fCfirstslice: 45\fR

.LP
\fBlabelmode\fR  \fClegend\fR | \fClabelonly\fR | \fCline+label\fR
.IP
Selects the method for labeling pie slices.
The default is \fClegend\fR.
.IP
\fClegend\fR: legend entries will be accumulated so that a legend
can be rendered subsequently using \fBproc legend\fR.
.IP
\fClabelonly\fR: pie slice labels will be superimposed onto or 
outside the pie slices with no connecting lines.
.IP
\fCline+label\fR: pie slice labels will be rendered outside of
the pie with connecting lines.
.IP
The \fClabelfarout\fR attribute may be helpful in positioning 
the labels.  If labels collide, the \fCfirstslice\fR attribute
may be used to rotate the pie which may alleviate the problem.
.IP
Labels text may be taken from data field (\fClabelfield\fR or be specified 
directly (\fClabels\fR).  
.br
Example: \fClabelmode: line+label\fR

.LP
\fBlabelfield\fR  
.ig >>
<a href="attributetypes.html#dfield">
.>>
\fI dfield \fR
.ig >>
</a>
.>>
.IP
If specified, label text will be taken from this data field.
Text may contain the characters \fC\\n\fR to symbolize line breaks.
The label text may contain the special symbol
\fB@PCT\fR which will evaluate to the percentage of the current slice
(use \fCpctfmt\fR attribute to control decimal format of @PCT).
.br
Example: \fCdatafield: 2\fR

.LP
\fBlabels\fR
.ig >>
<a href="attributetypes.html#text">
.>>
\fI multi-line text\fR
.ig >>
</a>
.>>
.IP
If specified, label text will be taken from this attribute, one line
per pie slice.
Text may contain the characters \fC\\n\fR to symbolize line breaks.
Remember to terminate the multi-line text with a blank line.
Label text may contain the special symbol
\fB@@PCT\fR which will evaluate to the percentage of the current slice
(use \fCpctfmt\fR attribute to control decimal format of @@PCT).
.br
Example:
.br
.ft C
.nf
labels:   Canada
	  Mexico
	  United\\nStates

.fi
.ft R

.LP
\fBlabelfarout\fR \fIz\fR
.IP
This attribute may be specified in order to control the placement of
labels.  It is a proportion of the radius.  A value less than 1.0 will
place labels inside the pie circle; a value greater than 1.0 will 
place labels outside the pie circle.  If \fClabelmode\fR is \fCline+label\fR
then \fIz\fR should be \fC1.2\fR or greater.

.LP
\fBcolors\fR
.ig >>
<a href="color.html">
.>>
\fI color list\fR
.ig >>
</a>
.>>
.IP
A space-separated list of colors, one per slice.
If all slices are to be the same color, just specify one color.
If the number of slices is more than the number of colors, the
last color is used for the remaining slices.
You can also just say \fCauto\fR which will use a pre-selected
color sequence.
.br
Example: \fCcolor: red green orange blue\fR

.LP
\fBexplode\fR \fIw1\fR.. \fIwN\fR
.IP
A space separated list of values, one per slice.
If all slices are to be exploded by the same amount, just specify
one value.  
If the number of slices is more than the number of values, the
last value is used for the remaining slices.
.IP
Each value is a proportion of the radius.
A value of \fC0.2\fR will explode a slice by 20% of the amount of the radius.
A value of \fC0.3\fR will explode a slice by 30%.
A value of \fC0.0\fR will not do any exploding.
Thus, one slice, selected slices, or all slices may be exploded.
.br
Example: \fCexplode: 0 0 0.2 0 0 0\fR


.LP
\fBtotal\fR \fIn\fR
.IP
Normally, the sum of all data is assumed to be the denominator
for determining pie slice proportions.  
However, if \fCtotal\fR is specified, it is taken to be the denominator.
This may be useful if the sum of the values do not represent the whole.
.br
Example: \fCtotal: 285\fR

.LP
\fBoutlinedetails\fR
.ig >>
<a href="linedetails.html">
.>>
\fI linedetails \fR
.ig >>
</a>
.>>
.IP
Details pertaining to the slice outlines.
To turn off slice outlines, use \fCnone\fR.
.br
Example: \fClinedetails: width=1.0 color=yellow\fR

.LP
\fBtextdetails\fR
.ig >>
<a href="textdetails.html">
.>>
\fI textdetails \fR
.ig >>
</a>
.>>
.IP
Details pertaining to the label text.
.br
Example: \fCtextdetails: color=blue size=10\fR

.LP
\fBlablinedetails\fR
.ig >>
<a href="linedetails.html">
.>>
\fI linedetails \fR
.ig >>
</a>
.>>
.IP
Details pertaining to the lines that may be rendered with the labels.

.LP
\fBpctformat\fR 
.ig >>
<a href="attributetypes.html#printfspec">
.>>
\fI printf-spec \fR
.ig >>
</a>
.>>
.IP
Controls the format of percentages shown in the labels
when @PCT is used.
.br
Example: \fCpctformat: %g\fR

#include bottom
