Create pie or donut charts in which the size of a pie slice represents
the value of the chart statistic for that category of data in relation to
the total chart statistic for all categories.
Requirements: |
At least one chart variable is required.
|
Global statements: |
LEGEND, PATTERN, TITLE, FOOTNOTE
|
Supports: |
Drill-down functionality
|
The PIE, PIE3D,
and DONUT statements specify the variable or variables that define the categories
of data to chart. These statements automatically
- determine the midpoints.
- calculate the chart statistic for each
midpoint
(the default is FREQ).
- scale each slice to represent its chart statistic.
No slice is drawn if the chart statistic for the midpoint is 0.
- order the slices by midpoint value in ascending
order starting at the three o'clock position and proceeding counterclockwise
around the pie.
- print the slice name (midpoint value) and slice
value (chart statistic) beside each slice.
- assign patterns and colors to the slices. The
default pie/star pattern is PSOLID.
You can use statement options to select or order the
midpoints (slices), to change the type of chart statistic, and to modify the
appearance of the chart, including the content and position of the slice labels,
and patterns used by the slices. You can also specify additional variables
by which to group, subgroup, or sum the data. Statement options can also produce
special effects, such as exploded or invisible slices.
Donut and pie charts allow grouping and subgrouping.
Grouping creates two or more separate pie or donut charts that display in
rows or columns on one graph. Subgrouping creates a separate ring of slices
within the circle for each value of the subgroup variable. The concentric
rings of the subgrouped pie or donut chart make it easy to compare slice values
between subgroups.
In addition, you can use global statements to modify
patterns and legends, as well as add titles, footnotes, and notes to the chart.
You can also use an Annotate data set to enhance the chart.
PIE | PIE3D | DONUT chart-variable(s) </
option(s);>
|
option(s)
can be one or more options from any or all of the following categories:
-
appearance options
|
ANNOTATE=Annotate-data-set |
|
CFILL=fill-color |
|
COUTLINE=slice-outline-color
| SAME |
|
EXPLODE=value-list |
|
FILL=SOLID |
X |
|
INVISIBLE=value-list |
|
NOHEADING |
|
WOUTLINE=slice-outline-width |
-
statistic options
|
FREQ=numeric-variable |
|
SUMVAR=summary-variable |
|
TYPE=statistic |
-
midpoint options
|
DISCRETE |
|
LEVELS=number-of-midpoints |
|
MIDPOINTS=value-list |
|
MIDPOINTS=OLD |
|
MISSING |
|
OTHER=percent-of-total |
-
grouping and subgrouping options
|
ACROSS=number-of-columns |
|
DOWN=number-of-rows |
|
GROUP=group-variable |
|
NOGROUPHEADING |
|
SUBGROUP=subgroup-variable |
-
slice-ordering options
|
ANGLE=degrees |
|
ASCENDING |
|
CLOCKWISE |
|
DESCENDING |
|
JSTYLE |
-
slice-labeling options
|
CTEXT=text-color |
|
LEGEND |
LEGEND=LEGEND<1...99> |
|
MATCHCOLOR |
|
NOLEGEND |
|
OTHERLABEL='text-string' |
|
PERCENT=ARROW
| INSIDE | NONE | OUTSIDE |
|
SLICE=ARROW | INSIDE | NONE | OUTSIDE |
|
VALUE=ARROW | INSIDE | NONE |
OUTSIDE |
-
donut-labeling options (DONUT only):
|
DONUTPCT=percent |
|
LABEL=(text
argument(s)) |
-
catalog
entry description options
|
DESCRIPTION='entry-description' |
|
NAME='entry-name' |
-
ODS
options
|
HTML=variable |
|
HTML_LEGEND=variable |
- chart-variable(s)
- specifies one or more variables that
define the categories of data to chart. Each chart variable draws a separate
chart. All variables must be in the input data set. Separate multiple chart
variables with blanks.
Options
in a PIE, PIE3D, or DONUT statement affect all graphs that are produced by
that statement. You can specify as many options as you want and list them
in any order. For details on specifying colors, see SAS/GRAPH Colors. For a complete description
of the graphics options, see Graphics Options and Device Parameters Dictionary.
-
ACROSS=number-of-columns
- draws number-of-columns
pies across the procedure output area. ACROSS is ignored unless you also use
the GROUP= option. By default, ACROSS=1.
If number-of-columns calls for more pies
than fit horizontally in the graphics output area, no pies are drawn and an
error message is written to the SAS log.
If the DOWN= option also is used, the pies are drawn
in left-to-right and top-to-bottom order.
-
ANGLE=degrees
- starts the first slice at the specified
angle. A value of 0 for degrees corresponds to the 3 o'clock
position. Degrees can be either positive or negative. Positive
values move the starting position in the counterclockwise direction; negative
values move the starting position clockwise. By default, ANGLE=0. Successive
slices are drawn counterclockwise from the starting slice.
-
ANNOTATE=Annotate-data-set
ANNO=Annotate-data-set
- specifies a data set to annotate
charts produced by the PIE, PIE3D, or DONUT statement.
Note: Annotate coordinate systems 1, 2, 7, and 8 (data system coordinates) are not
valid with pie or donut charts.
-
ASCENDING
- arranges the slices in ascending
order of the value of the chart statistic. By default, slices are arranged
in ascending order of midpoint value, without regard to size. ASCENDING reorders
the slices from smallest to largest. The OTHER slice is still last regardless
of its size.
If you also use the GROUP= option, the reordering is
performed separately for each group, so the order of the midpoint values may
be different for each pie or donut.
ASCENDING overrides any midpoint order that is specified
with the MIDPOINTS= option.
-
CFILL=fill-color
- specifies one color for all patterns
in the chart, regardless of whether the fill is solid or hatch. For the PIE3D
statement, the fill is always solid. For the PIE and DONUT statements, if
no pattern is specified on the PATTERN statement or with the FILL= option,
the procedure starts with the default solid fill and then, beginning with
P2N0, uses each default pie hatch pattern with the specified color. For the
outline color, the procedure uses the foreground color, which is the first
color in the colors lists. Use COUTLINE= to specify a different outline color.
CFILL= overrides any other pattern color specification and controls the color
of all slices.
-
CLOCKWISE
- draws the slices clockwise starting
at the 12 o'clock position. Although this position implies ANGLE=90, you can
use ANGLE= to specify a different starting angle.
-
COUTLINE=slice-outline-color
| SAME
- outlines all slices, rings (subgroups),
and legend values (if a legend appears) in the specified color. SAME specifies
that the outline color of a slice or a slice segment or a legend value is
the same as the interior pattern color.
The default outline color depends on the PATTERN statement:
- If no PATTERN statement is
specified, the default
outline color is the foreground color (the first color in the colors list).
- If a PATTERN statement or the V6COMP graphics
options is specified, the default is COUTLINE=SAME.
Note: If you specify empty patterns
(VALUE=PEMPTY in a PATTERN statement), you should not change the outline color
from the default value, SAME, to a single color. Otherwise, all of the outlines
will be one color and you will not be able to distinguish between the empty
areas.
-
CTEXT=text-color
- specifies the color for all text
on the chart that is not otherwise assigned a color. Text includes all slice
labels, the chart heading, and group headings if grouping is used. CTEXT=
also affects the color of the slice label arrows. See Selecting and Positioning Slice Labels.
If you omit CTEXT=, PROC GCHART
searches for a color
specification in this order:
- the CTEXT= option in a GOPTIONS statement
- the first color in the colors
list (the default).
The MATCHCOLOR option overrides the CTEXT= option for
slice labels.
-
DESCENDING
- arranges the slices in descending
order of the value of the chart statistic. By default, slices are arranged
in ascending order of midpoint value, without regard to size. DESCENDING
reorders the slices from largest to smallest. The OTHER slice is still last,
regardless of its size.
If you also use the GROUP= option, the reordering is
performed separately for each group, so the order of midpoint values may be
different for each pie or donut.
DESCENDING overrides any midpoint order that is specified
with the MIDPOINTS= option.
-
DESCRIPTION='entry-description'
DES='entry-description'
- specifies the description of the
catalog entry for the chart. The maximum length for entry-description is 40 characters. The description does not appear on the chart. By
default, the GCHART procedure assigns a description of the form PIE (or PIE3D
or DONUT) CHART OF variable, where variable is the
name of the chart variable.
The entry-description can include the #BYLINE, #BYVAL,
and #BYVAR substitution options, which work as they do when used on TITLE,
FOOTNOTE, and NOTE statements. For more information, refer to the description
of the options, and Substituting BY Line Values in a Text String.
The 40-character limit applies before the substitution takes place for these
options; thus, if in the SAS program the entry-description text exceeds 40
characters, it is truncated to 40 characters, and then the substitution is
performed.
The descriptive text is shown in the "description" portion of each of
the following:
- in the Results window
- among the catalog-entry properties that you can view from the
Explorer window
- in the Table of Contents that is generated when you use CONTENTS=
on an ODS HTML statement (see Linking to Output through a Table of Contents),
assuming the GCHART output is generated while the contents page is open
- in the Description field of the PROC GREPLAY
window
-
DISCRETE
- treats a numeric chart variable as
a discrete variable rather than as a continuous variable. The GCHART procedure
creates a separate midpoint and, hence, a separate slice for each unique value
of the chart variable. If the chart variable has a format associated with
it, each formatted value is treated as a midpoint.
The LEVELS= option is ignored when you use DISCRETE.
The MIDPOINTS= option overrides DISCRETE.
-
DONUTPCT=percent (DONUT
only)
- specifies the size of the donut hole
in percent of the radius of the whole chart. Values of percent
range from 0 to 99. By default, DONUTPCT=25.
-
DOWN=number-of-rows
- draws number-of-rows
pies vertically in the procedure output area. The DOWN= option is ignored
unless you also use the GROUP= option. By default, DOWN=1.
If number-of-rows calls for more pies
than fit vertically in the graphics area of the output device, no pies are
drawn and an error message is written to the SAS log.
If you also use the ACROSS= option, the pies are drawn
in left-to-right and top-to-bottom order.
-
EXPLODE=value-list
- pulls the specified slices slightly
out from the rest of the pie for added emphasis. Value-list
is the list of midpoint values for the slices to be exploded. See the MIDPOINTS=
option for a description of value-list.
The values in the value list must match the existing
midpoints exactly, including the case of character midpoints. Any values
in the list that do not correspond to existing midpoints are ignored.
When you use EXPLODE=, the radius is reduced to allow
room for exploded slices.
EXPLODE= does not work with subgroups.
-
FILL=SOLID | X
- specifies the fill pattern for all slices in the chart:
- SOLID S
- rotates a solid fill through the
colors list as many times as necessary. This is the default.
- X
- rotates a single hatch pattern through
the colors list as many times as necessary. PIE3D does not support FILL=X.
If you use default device colors (the COLORS= option
is omitted), the fill skips the first color in the colors list.
FILL= overrides any pattern that is specified in PATTERN
statements.
By default, the outline color is the first color in
the colors list. If PATTERN statements are used to specify colors, the slice
outline color matches the slice fill color.
By default, the fill patterns take the colors from the
current colors list in rotation. If any PATTERN statements have been defined,
the colors in the PATTERN definitions are used, in order, before the default
color rotation.
-
FREQ=numeric-variable
- specifies a variable whose values
weight the contribution of each observation in the computation of the chart
statistic. Each observation is counted the number of times specified by the
value of numeric-variable for that observation. If the value
of numeric-variable is missing, 0, or negative, the observation
is not used in the statistic calculation. Noninteger values of numeric-variable are truncated to integers.
FREQ= is valid with all chart
statistics.
Because you cannot use TYPE=PERCENT or TYPE=FREQ with
the SUMVAR= option, you must use FREQ= to calculate percentages and frequencies
based on a sum.
-
GROUP=group-variable
- organizes the data according to values
of group-variable and produces a separate pie (or donut) chart
for each unique value of group-variable. Group-variable can be either character or numeric and is always treated as a discrete
variable. Missing values for group-variable are treated as a
valid group. By default, each group includes only those midpoints with nonzero
chart statistic values.
By default, the charts are produced in ascending order
of group variable value and each is drawn on a separate page or display. Therefore,
the effect of GROUP= is essentially the same as using a BY statement except
that GROUP= causes the midpoints with the same value to use the same color
and fill pattern. To place more than one pie on a page or display, use the
ACROSS= or DOWN= options, or both.
-
HTML=variable
- identifies the variable in the input
data set whose values create links in the HTML file that is created by the
ODS HTML statement. These links are associated with an area of the chart and
point to the data or graph that you wish to display when the user drills down
on the area.
-
HTML_LEGEND=variable
- identifies the variable in the input
data set whose values create links in the HTML file created by the ODS HTML
statement. These links are associated with a legend value and point to the
data or graph that you wish to display when the user drills down on the value.
-
INVISIBLE=value-list
- makes the specified slices invisible,
as if they had been removed from the pie. Labels are not printed for invisible
slices. Value-list is the list of midpoint values for the invisible
slices. See the MIDPOINTS= option for a description of value-list.
The values in the
value list must match the existing
midpoints exactly, including the case of character midpoints. Any values
in the list that do not correspond to existing midpoints are ignored.
-
JSTYLE
- arranges the midpoints in descending
order of the statistic value and draws the slices clockwise starting at the
12 o'clock position. The JSTYLE option has the same effect as specifying both
the DESCENDING and CLOCKWISE options.
-
LABEL=(text argument(s)) (DONUT only)
- defines the text that is displayed
in the donut hole. Text-argument(s) defines the text or the
appearance of the label, or both. Text-argument(s) can be one
or more of the following:
- 'text-string'
- provides the text of the label. Enclose
each string in quotation marks. Separate multiple strings with blanks.
- text-description-suboption
- modifies a characteristic such as
the font, color, or size of the text string(s) that follows it. Text-description-suboption can be
| ANGLE=degrees |
| COLOR=color |
| FONT=font |
| HEIGHT=text-height
<units> |
| JUSTIFY=LEFT | CENTER |
RIGHT |
| ROTATE=degrees |
See
Text Description Suboptions
for a complete description.
Specify as many text strings and text description suboptions
as you want, but enclose them all in one set of parentheses.
-
LEGEND |
LEGEND=LEGEND<1...99>
- generates a legend for the slice
names (midpoint values) instead of printing them beside the slices. The legend
displays each slice name and its associated pattern. This option also suppresses
the display of the chart statistic values. To display the chart statistics,
use the VALUE= option.
If you use the SUBGROUP= option, the legend is automatically
generated. However, because patterning is always by midpoint, the legend still
describes the midpoint values, not the subgroups.
Note: If you request a legend and the slices use hatch patterns, the patterns in
the slices are oriented to be visually equivalent to the legend.
Specifying LEGEND=LEGENDn assigns the specified
LEGEND statement to the legend.
-
LEVELS=number-of-midpoints
- specifies the number of midpoints
for a numeric chart variable. The range for each midpoint is calculated automatically.
LEVELS= is ignored if
- the chart variable is character type
- the DISCRETE option is
used
- the MIDPOINTS= option is used.
-
MATCHCOLOR
- uses the slice pattern color for
all slice labels. MATCHCOLOR overrides the color that is specified in the
CTEXT= option.
-
MIDPOINTS=value-list
- specifies the midpoint values for
the slices. The way you specify value-list depends on the type
of variable:
- For numeric chart variables, value-list is either an explicit list of values, or a starting and
an ending value with an interval increment, or a combination of both forms:
| n <...n> |
| n TO n <BY
increment> |
| <n...> n TO n <BY increment> <n
<...n>> |
If a numeric variable has an associated format, the
specified values must be the unformatted values.
By default, numeric variable values are treated as continuous
(if you omit the DISCRETE option), and
- the lowest midpoint consolidates all data points from negative
infinity to the median of the first two midpoints
- the highest midpoint consolidates all data points from the median
of the last two midpoints up to infinity
- all other values in value-list specify the median
of a range of values, and the GCHART procedure calculates the midpoint values.
If you include the DISCRETE option, each value in value-list
specifies a unique numeric value.
- For character chart variables, value-list is a list of unique character values enclosed in
quotation
marks and separated by blanks:
If a character variable has an associated format, the
specified values must be the formatted values.
For a complete description of value-list,
see the ORDER= option in the AXIS statement.
Midpoints that represent small percentages are collected
into a generic midpoint named OTHER. See the OTHER= option and the
OTHERLABEL= option for
more information.
-
MIDPOINTS=OLD
- tells the GCHART procedure to calculate
default midpoints using the algorithm used in Release 82.4 and Version 5 of SAS/GRAPH.
The MIDPOINTS=OLD option is ignored unless the numeric chart variable is numeric
type.
-
MISSING
- accepts a missing value as a valid
midpoint for the chart variable. By default, observations with a missing
value are ignored. Missing values are always valid for the group and subgroup
variable.
-
NAME='entry-name'
- specifies the name of the catalog
entry for the graph. The maximum length for entry-name is eight
characters. The default name is GCHART. If the name duplicates an existing
entry name, SAS/GRAPH software adds
a number to the duplicate name to create a unique name- for example,
GCHART1.
-
NOGROUPHEADING
- suppresses the headings that are
normally printed above each pie when you use the GROUP= option.
-
NOHEADING
- suppresses the heading that is normally
printed at the top of each page or display of output.
-
NOLEGEND
- suppresses the legend that is automatically
generated by the SUBGROUP= option. NOLEGEND is ignored if the SUBGROUP= option
is not used.
-
OTHER=percent-of-total
- collects all midpoints with chart
statistic values less than or equal to percent-of-total into
a generic midpoint named OTHER. The value of percent-of-total
can be 0 to 100; the default value is 4. Therefore, any slice that represents
4 percent or less of the total is put in the OTHER category.
Note: If you specify a small value for percent-of-total, the GCHART
procedure may not be able to label all of the small slices.
The OTHER slice is the last slice in the pie, regardless
of the order of the slices. (In other words, it is the slice immediately
before the starting slice.)
If only one midpoint falls into the OTHER category,
its slice is displayed in its normal position in the pie and retains its original
label. For example, suppose a pie has these slices and percent values: Coal
35%, Gas 15%, Hydro 5%, and Oil 45%. If you specify OTHER=5, Hydro remains
the third slice instead of becoming the last slice.
-
OTHERLABEL='text-string'
- specifies a text string up to 16
characters for the label for the OTHER slice. The default label is OTHER.
-
PERCENT=ARROW | INSIDE | NONE | OUTSIDE
- prints the percentage represented
by each slice using the specified labeling method. For a description of the
option values, see Selecting and Positioning Slice Labels.
By default, PERCENT=NONE (percentage is not displayed).
Whether the slice percent displays with or without decimal
places, depends on the range of values across the chart.The only way to control
the appearance of these values is to calculate the percentage with a DATA
step or statistical procedure and use the resulting data set as input to the
GCHART procedure. Assign the variable that contains the calculated percentages
to the SUMVAR= option.
-
SLICE=ARROW | INSIDE | NONE | OUTSIDE
- controls the position and style of
the slice name (midpoint value) for each slice. For a description of the
option values, see Selecting and Positioning Slice Labels.
By default, SLICE=OUTSIDE (the name is outside of the slice).
-
SUBGROUP=subgroup-variable
- divides the chart into concentric
rings according to the values of subgroup-variable. Subgroup-variable can be either character or numeric and is always treated as a discrete
variable.
The width of the rings, which is the same for each subgroup,
is determined by the radius of the pie and the size of the donut hole, if
any.
By default, the subgroup rings are ordered from the
outside in, alphabetically (if character) or numerically (if numeric). If
the JSTYLE option is also used, the order of the slices within the subgroups
is determined by the outermost subgroup. Any inner subgroup that contains
a value that is not in the outer subgroup, places the new slice for that value
either last or just before the "other" slice, if one is present. That slice
order is continued for any remaining subgroups.
Each ring is labeled with its subgroup value; labels
are placed to the right of the chart. If the GROUP= option is also used, only
the first (upper left) chart on each page is labeled.
By default the subgroups are outlined in the foreground
color. To specify an outline color, use the COUTLINE= option.
SUBGROUP= automatically generates a legend for the midpoint
values (not the subgroup values) and suppresses display of the chart statistic.
By default the legend appears at the bottom of the chart. To modify the legend,
assign a LEGEND definition. To suppress the legend, specify NOLEGEND. To
display the chart statistic, use the VALUE= option.
If EXPLODE is also used, it is ignored.
-
SUMVAR=summary-variable
- specifies a numeric variable for
sum or mean calculations. The GCHART procedure calculates the sum or, if
requested, the mean of numeric-variable for each midpoint. The
resulting statistics are represented by the size of the slice and displayed
beside of each slice.
When you use SUMVAR=, the TYPE= option must be either
SUM or MEAN. With SUMVAR=, the default is TYPE=SUM.
-
TYPE=statistic
- specifies the chart statistic.
- If the SUMVAR= option is not used, statistic can be one of the following:
- FREQ
- frequency (the default)
- PERCENT PCT
- percentage
- If SUMVAR= is used, statistic can
be one of the following:
- SUM
- sum (the default)
- MEAN
- mean
Because you cannot use TYPE=FREQ or TYPE=PERCENT with
SUMVAR=, you must use FREQ= to calculate percentages or frequencies based
on a sum. See also Calculating Weighted Statistics.
-
VALUE=ARROW | INSIDE | NONE | OUTSIDE
- controls the position and style of
the slice value (chart statistic) for each slice. For a description of the
option values see Selecting and Positioning Slice Labels.
By default, VALUE=OUTSIDE (the value is outside the slice).
-
WOUTLINE=slice-outline-width
- specifies the width of the outline
in pixels. WOUTLINE= affects both the slice and the subgroup outlines.
The LABEL= option in the DONUT statement uses text description
suboptions to change the color, height, justification, font, and angle of
the following text string(s).
- ANGLE=degrees
A=degrees
- specifies the angle at which the
baseline of the text string(s) is rotated with respect to the horizontal.
A positive value for degrees moves the baseline counterclockwise;
a negative value moves it clockwise. By default, ANGLE=0 (horizontal).
- COLOR=color
C=color
- specifies the color for the text
string(s). The COLOR= suboption stays in effect until another COLOR= specification
is encountered. If you omit COLOR=, LABEL= uses the first color in the colors
list. It ignores the CTEXT= graphics option. See SAS/GRAPH Colors for details on specifying
color.
- FONT=font
F=font
- specifies the font for the text string(s).
If you omit FONT=, LABEL= uses the font that is specified by the FTEXT= graphics
option. If no font is specified, it uses the default hardware font, NONE.
See SAS/GRAPH Fonts
for details on specifying font.
- HEIGHT=text-height <units>
H=text-height <units>
- specifies the height of the text
string(s). Text-height is the number of units. If you omit HEIGHT=,
LABEL= uses the height that is specified by the HTEXT= graphics option. If
no text height is specified and if the default text height is too large for
the donut hole, the size of the label is reduced to fit. Units
can be CELLS | CM | IN | PCT | PT. If you omit units, HEIGHT=
uses the unit that is specified by the GUNIT= graphics option, or the default
unit, CELLS.
- JUSTIFY=LEFT | CENTER | RIGHT
J=L | C | R
- specifies the alignment of the text
string(s). By default, JUSTIFY=CENTER.
- ROTATE=degrees
- specifies the angle at which each
character is rotated with respect to the baseline of the text string. The
angle is measured from the current text baseline angle specified by the ANGLE=
suboption. A positive value for degrees rotates the character
counterclockwise; a negative value rotates it clockwise. By default, ROTATE=0
(parallel to the baseline).
By default,
each slice is labeled with its midpoint value (slice
name) and its chart statistic value (slice value), which are printed outside
of the slice. You can control where and how these labels are displayed with
the SLICE= and VALUE= options, respectively. In addition, each slice can
display the percentage its midpoint contributes to the total chart statistic(slice
percent). Use the PERCENT= option to request slice percent.
The SLICE=, VALUE=, and PERCENT= options
use the same values:
- ARROW
- places the text outside the slice
and connects the text to the slice with a line. This labeling method reduces
the radius of the pie. The arrow uses the color that is specified by CTEXT=
in the PIE, PIE3D, or DONUT statement. If CTEXT= is omitted, the arrow uses
the first color in the colors list.
- INSIDE
- places the text inside the slice.
The label overlays the slice fill patterns. This labeling method increases
the radius of the pie.
- NONE
- suppresses the text.
- OUTSIDE
- places the text outside of the
slice.
Slice Labeling Methods
illustrates these values.
Slice Labeling Methods
The SLICE=
and VALUE= options are dependent on each
other. If you specify only VALUE= or only SLICE=, the other option automatically
uses the same labeling method. PERCENT= is independent of these two.
Be careful about the combinations that you specify.
For example, if you specify PERCENT=ARROW and VALUE=OUTSIDE, the line that
connects the percentage information to each slice may overlay the statistic
value.
If your pie has many slices, the labels may overlap,
particularly if there are several small slices together. You can correct
the overlapping labels by using
- FTEXT= graphics option to decrease the size of
the labels.
- the Graphics Editor to adjust the labels by moving
or resizing the text.
- ANGLE= to change the orientation of the pie.
- MIDPOINTS= to rearrange slices so that small slices
are not together.
- OTHER= to group more midpoints into the OTHER
category.
- the HPOS= and VPOS= graphics options to increase
the number of cells in your display. (See About the Graphics Output Area for details.)
Pie and donut charts are always patterned by midpoint. Even
when you specify subgrouping, the patterning method does not change from midpoint
to subgroup.
Each slice in a pie or donut chart is filled with a pattern. By default,
the procedure
- fills the slices with pie/star patterns, beginning
with the default fill, PSOLID, and rotating through the colors in the colors
list. When the solid patterns are exhausted, the procedure selects the next
default pie/star pattern and rotates it through the colors list. It continues
in this fashion until all of the required patterns have been assigned.
Note: PIE3D always uses solid patterns.
If you use the device's
default colors and the first
color in the list is either black or white, the procedure does not create
a pattern in that color. If you specify a colors list with the COLORS= graphics
option, the procedure uses all the colors in the list to generate the patterns.
- outlines slices and subgroup segments using the
first color in the colors list. To change the outline color, use the COUTLINE=
option.
See About Patterns
for more information on how the GCHART procedure assigns default patterns
and outlines.
You
can control slice patterns and their outlines in several ways.
- To select a different fill for the slices, such
as empty or hatched, you can
- request a single hatched fill pattern for all
slices by specifying the FILL=X option on the PIE or DONUT statement. The
pattern specified by FILL=X rotates through the colors list as many times
as needed to generate all of the patterns that are required by the chart.
If you specify a single color with either CFILL= or the graphics option, CPATTERN=,
all slices use the same color as well as the same pattern.
- specify a pattern with the VALUE= option in the
PATTERN statement. Only pie/star patterns are valid; all other pattern specifications
are ignored. For a complete description of all pie/star patterns, see VALUE=
in PATTERN Statement.
If no color options are specified, the procedure rotates
each specified fill once through the colors list. Otherwise the PATTERN statement
generates one pattern definition for the specified pattern and color. When
all of the specified patterns are exhausted, the procedure starts rotating
through the default pie/star patterns, beginning with PSOLID.
- To select colors for the slices, you can
- specify a single pattern color with the CFILL=
option, or with the CPATTERN= graphics option, or with a colors list of one
color. For the PIE and DONUT statements, CFILL= starts with the default solid
color and uses the foreground color for outlines, whereas CPATTERN= and a
colors list of one color skip the solid pattern and, beginning with P2N0,
use each pie/star hatch pattern with the specified color, and use the fill
color for the outline color.
- specify only COLOR= in one or more PATTERN statements.
In this case, the procedure creates a solid pattern for each specified color.
When it runs out of PATTERN statements, it returns to the default patterns,
beginning with PSOLID, and rotates them each through the colors list. Whenever
you specify a PATTERN statement, the default outline color is SAME.
- To define specific patterns and colors for the
slices, use PATTERN statements and specify both the VALUE= and COLOR= options.
If you provide fewer PATTERN definitions than the chart requires, the GCHART
procedure uses the default pattern rotation for the slices that are drawn
after all of the defined patterns are exhausted.
Whenever you use PATTERN statements, the default outline
color changes to SAME. That is, the outline color is the same as the fill
color. To change the outline color, use the COUTLINE= option.
See
About Patterns
for more information on how the GCHART procedure uses patterns and outlines.
See PATTERN Statement
for a description of default pie/star patterns.
By default, the procedure prints a heading at the top of each
pie (or donut) chart that indicates the type of statistic charted and the
name of the chart variable- for example, SUM of SALES by SITE. You can suppress this heading with the NOHEADING option.
When you use the GROUP= option, a
heading is printed
above each pie indicating the name of the group variable and its value for
the particular pie- for example, SITE=Paris. You
can suppress these headings with the NOGROUPHEADING option. You can also
suppress the variable name SITE= so that only the value Paris remains. To do this, use a LABEL statement and assign a null
value to the variable name, for example,
label site='00'x;
Because the AXIS statement cannot be used by the PIE,
PIE3D, and DONUT statements, you should use the FTEXT= and HTEXT= graphics
options to control the font and height of text on the chart. Increasing the
value of the HTEXT= graphics option decreases the size of the pie if any slice
labels are positioned outside.
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.