Doing More with SAS/ASSIST Software |
In the "Graphics"
chapter of
Getting Started with the SAS System Using SAS/ASSIST Software, you learned how to create a simple pie chart. This
section describes some of the more advanced options available when generating
pie charts.
In this section you create a pie chart that shows
what portion
of the CLASS table falls into each age group. You select the pattern, labeling,
and header options, and explode a slice.
Setting Up the Pie Chart
- To
display the Pie Chart
window, follow this selection path starting from the WorkPlace menu:
Tasks |
|
Graphics |
|
Pie
chart |
The Pie Chart window
appears.
Pie Chart Window
- Use the
Table button
to select the CLASS table.
- Use the Chart column
button to select AGE as the column you want the
pie to represent.
- Select 2D if it is
not already selected.
- Select Number of slices.
The Midpoint Values window appears. The Midpoint Values window is the same for pie charts and bar charts.
The sizes of
the slices are determined by the values
of the chart column. If you have any slices that represent four percent or
less of the total pie, these slices are grouped together automatically into
one slice labeled OTHER.
- Select Use each discrete chart column
value; the Pie Chart window reappears.
You select Use discrete chart column value to display one slice
of pie for each age represented in the
CLASS table, that is 11, 12, 13, 14, 15, and 16. The default for the number
of bars is Let the number of midpoints default,
which lets the procedure determine the number of midpoints (pie slices) for
the chart column. Each midpoint represents a median of a range of values.
In this example, if you use Let the number of midpoints default, the pie slices represent the midpoints of the AGE column,
that is 11.4, 12.6, 13.8, 15, and 16.2.
The window that appears when you select Number of slices is different for numeric and character chart
columns.
Setting Additional Options
- Select Additional options;
the Additional Options window appears.
-
Select Color and pattern options. The Color and Pattern
Options window appears. The Color and Pattern Options window is the same for pie charts and bar charts.
- For the
1ST and 4TH areas, select Cross as the pattern.
For the 2ND and
5TH areas, leave the pattern as Solid.
For the 3RD and 6TH
areas, select Empty as the pattern.
The pattern selected by default for the pie slices is Solid. If you print a black
and white graphic as shown in this
book, you can use the pattern options to distinguish one pie slice from another.
If you print a color graphic, you can use colors for
the various pie slices to distinguish one pie slice from another. To display
a list of valid colors, type
?
in the first position of the Color field
and press ENTER. Select the color you want to use.
- Select OK to return
to the Additional Options window.
-
Select Labeling
options. The Labeling Options window appears.
Labeling Options Window
- Select Label slice with
percentage
of pie, and de-select Label slice with value of
each slice.
You choose the label selections as indicated so that
the percent of students in each age group is shown on the pie. If you leave Label slice with value of each slice selected, the number of
students in each age group (rather than the percentage) is shown on the pie.
- Select OK to return
to the Additional Options window.
-
Select General slice
options. The General Slice Options window appears.
General Slice Options Window
- Select Use automatic
heading
to generate an automatic title for the chart.
- To emphasize the slice representing 13-year-olds
from the rest of the slices, select Explode a Pie Slice.
The Explode a Pie Slice window appears.
Explode a Pie Slice
- In the
Midpoint value
field, type
13
and select OK.
- Select OK and then Goback to return to the Pie
Chart
window.
Running the Pie Chart
- Follow
this selection path:
Run |
|
Submit |
The pie chart appears
in the GRAPH window.
Pie Chart Output
Note: Titles carry over from
one report or graphic to
another. If you do not type a title and a title was selected previously in
the current SAS/ASSIST session, the previous title automatically appears on
this graphic.
If the title Mean Weight by Age
appears at the top of the chart, this title carried over from the chart created
in the previous section. To delete the title, from the Pie Chart window, select Edit, Titles, and
Reset.
- To return to SAS/ASSIST software from the GRAPH
window, follow this selection path:
File |
|
Close |
Pie Chart Display Options
By default, pie charts are two dimensional.
However, you can select 3D, Donut, or Star to produce pie charts as
shown in the following examples.
Three-dimensional Pie Chart Output
Donut Pie Chart Output
Star Pie Chart Output
Slice Values
By default, pie slices represent the frequency of each
value
of the chart column. By selecting Slice values,
however, you can make the slices represent one of several statistics on analysis
column for each value of the chart column. For example, using the CLASS table,
you could select the WEIGHT column as an analysis column and Sum as a statistic; the slices would then represent the total
weight of the children of each age as a percentage of the total weight of
all the children.
Additional Options
By Selecting Additional
Options, you
can
- specify the angle of the first pie slice
- specify the color used to outline the pie
slices
- specify the size of the slice assigned to OTHER
- specify the color, size, and font of the
labels
- match the label color with the slice color
- include missing values as a legitimate value for
generating a slice.
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.