| 
 Search 
 
 Ploticus >
  Scripts >
 
 
 
  Display a pie graph using the
current data set.
Values will be displayed as a proportion of the sum, unless
the total attribute is specified.  Proc pie does not require a
current plotting area
to be in effect.
See also the 
gallery pie examples. 
 
 
 
 
 AttributesThe datafield, center, and radius attributes
must be specified.
 
 
datafield
   
dfield
 
The data field containing the plottable values.
 
 
center
   
x y
 
Location of the center of the pie.
Example: center: 3 5.6
 
 
radius
   
lenvalue
 
Radius of the pie.
Example: radius: 1.5
 
 
 
 
 Slice labeling
labelmode  
   
legend | labelonly | line+label
 
Selects the style for labeling pie slices.  Legal values include:
legend - legend entries will be accumulated so that a legend
can be rendered later using proc legend.  This is the default.
 
labelonly -  pie slice labels will be superimposed onto or 
outside the pie slices with no connecting lines.
 
line+label - pie slice labels will be rendered outside of
the pie with connecting lines.
 
The labelfarout attribute may be helpful in positioning 
the labels.  If labels collide, the firstslice attribute
may be used to rotate the pie which may alleviate the problem.
Labels text may be taken from data field (labelfield) or be specified 
directly (labels).  
 
Example: labelmode: labelonly
Example: labelmode: line+label
 
 
 
wraplen
   
nchars
 
If specified, label text will be wordwrapped to a maximum line length of nchars characters.
New in 2.32
 
 
labelfmtstring
   
string
 
A format string that allows pie slice label content to come from one or more data fields.
Text may also contain the characters \\n to symbolize line breaks, and
the special symbol @@PCT which will evaluate to the percentage of the current slice
(use pctfmt attribute to control displayed decimal format of the percents).
This attribute is incompatible with labelfield ... you can use one or the other, but not both.
Example: labelfmtstring: @@3 (@@PCT)
 Example: labelfmtstring: @@1 \\n @@2
 
 
 
labelfield  
   
dfield
 
If specified, label text or legend text will be taken from this data field
(but see newer attribute labelfmtstring above which is more flexible and recommended instead).
The label data field may contain the characters \\n to symbolize line breaks,
as well as the special symbol
@PCT which will evaluate to the percentage of the current slice
(use pctfmt attribute to control displayed decimal format of the percents).
This attribute is incompatible with labelfmtstring ... you can use one or the other, but not both.
Example: labelfield: 2
 
 
 
labels
   
multi-line text
 
If specified, label text will be taken from this attribute, one line
per pie slice.
The label text may contain the characters \\n to symbolize line breaks.
Remember to terminate the multi-line text with a blank line.
Label text may contain the special symbol
@PCT which will evaluate to the percentage of the current slice
(use pctfmt attribute to control decimal format of @PCT).
Example:
 
 
labels:   Canada
	  Mexico
	  United\\nStates
 
 
 
 
 Slice colors and outlineThere are several ways to specify slice colors.  Colors may be driven by
data or given explicitly.  Slices may be outlined or not.
exactcolorfield
   
dfield
 
If specified, the color of each individual bar is controlled by this data field directly.
The data field should hold recognized
color names.
 
 
colorfield
   
dfield
 
If specified, the color of each individual bar is controlled by this data field,
using
legend-driven technique
(the legend serves as a mapping table to map data values to colors).
 
 
colors
   
color list
 
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 auto which will use a pre-selected
color sequence.
Example: color: red green orange blue
 
 
 
outlinedetails
   
linedetails
 
Details pertaining to the slice outlines.
To turn off slice outlines, use none.
Example: linedetails: width=1.0 color=yellow
 
 
 
 
 
 Slice positioning, etc.
firstslice 
   
n
 
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.
Example: firstslice: 45
 
 
 
explode 
   
w1.. wN
 
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.
 
Each value is a proportion of the radius.
A value of 0.2 will explode a slice by 20% of the amount of the radius.
A value of 0.3 will explode a slice by 30%.
A value of 0.0 will not do any exploding.
Thus, one slice, selected slices, or all slices may be exploded.
Example: explode: 0 0 0.2 0 0 0
 
 
 
total 
   
n
 
Normally, the sum of all data is assumed to be the denominator
for determining pie slice proportions.  
However, if total is specified, it is taken to be the denominator.
This may be useful if the sum of the values do not represent the whole.
Example: total: 285
 
 
 
 
 
 Slice labelling details
textdetails
   
textdetails
 
Details pertaining to rendering of the label text.
Example: textdetails: color=blue size=10
 
 
 
labelfarout 
   
z
 
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 labelmode is line+label
then z should be 1.2 or greater.
 
 
labelback 
   
color
 
If specified, labels will have a backing box shaded this color.
Example: labelback: dullyellow
 
 
 
labelbackoutline 
   
 yes | no 
 
If specified as yes, labels will have an outlined backing box.
 
 
lablinedetails
   
linedetails
 
Details pertaining to the lines that may be rendered with the labels.
 
 
pctformat 
   
printf-spec
 
Controls the format of percentages shown in the labels
when @PCT is used.
Example: pctformat: %g
 
 
 
 
 
 Clickmaps and mouseover
clickmapurl 
   
url-template
 
If generating an
HTML clickmap
, this specifies a url template, and causes the
pie graph labels (but not the slice regions themselves) to be mapped.
This attribute usually contains one or more embedded
data field references
preceded by double at-sign (@@).
See
HTML clickmap
for more details and examples.
Example: clickmapurl: http://abc.com/mycgi?category=@@3
 
 
 
clickmaplabel 
   
label-template
 
If generating a
client-side clickmap,
this specifies a template for building mouseover text labels.
These are associated with the pie graph labels, but not the entire slice regions.
Example: clickmaplabel: @@3 (@@4)
 
clickmaplabeltext
   
multiline text
 
Same as clickmaplabel but multiline text.  Must be terminated with a blank line.
 
 |