The PIECHART statement
is used in a LAYOUT REGION, LAYOUT GRIDDED, or LAYOUT LATTICE block.
It cannot be used in LAYOUT OVERLAY block because a pie chart does
not have axes. The input data for the PIECHART statement is raw, unsummarized
input data. The PIECHART performs discrete binning for the CATEGORY
column and calculates appropriate summarization statistics (sum, mean,
and so on) based on the setting for the
STAT= option.
By default, the fill
color of each pie slice is derived from the Color attribute of the
GraphData1–GraphDataN style elements. When the number of categories
exceeds the number of GraphDataN elements, the GraphData1–GraphDataN
colors are repeated, but the shade of each color is varied on each
cycle. The shade variations alternate between one shade lighter and
one shade darker on each cycle. The fill color of the “other”
slice (if shown) is derived from the Color attribute of the GraphOther
style element.
The default order of
the pie slices depends on the data type of the CATEGORY values:
-
For numeric data, the slices appear
in the ascending order of the unformatted data values.
-
For discrete data, the slices appear
in data order.
By default, the pie
slices are labeled with the CATEGORY and RESPONSE values, which are
displayed inside the slices. You can use the
DATALABELLOCATION= and
DATALABELCONTENT= options to control where the pie
slices are labeled and the label content.
By default if two or
more slices take up less than 4% of a pie, an “other”
slice is created by consolidating those small slices. To change the
default criteria, use the
OTHERSLICE= and
OTHERSLICEOPTS= options. The calculated “other”
slice is displayed as the last slice in the pie, and as the last legend
entry for the pie. If a category value is the same as the “other”
slice label, two slices might be displayed with the same label ("Other"
by default) and different fill attributes. In that case, both slices
are represented in the pie legend.
To create a pie slice
for missing CATEGORY values, specify INCLUDEMISSINGDISCRETE=TRUE in
the BEGINGRAPH statement. The fill color of the missing category slice
is assigned the fill color from the GraphMissing style element except
when a user-defined format is applied to the category value. In that
case, the missing category slice is assigned the fill color from a
GraphData1–GraphDataN style element in data order instead.
Note: The PIECHART statement does
not honor the MISSING= system option. Regardless of the MISSING= system
option value, unless a user-defined format is applied to the value,
the default missing-numeric-value character (.) is used to depict
missing numeric values.