Previous Page | Next Page

Doing More with Graphics

Doing More with Pie Charts

In the "Graphics" chapter of Getting Started with SAS/ASSIST, you learned how to create a simple pie chart. This section describes some of the more advanced options available when generating pie charts.


Creating a Pie Chart

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

  1. To display the Pie Chart window, follow this selection path starting from the WorkPlace menu:Tasks [arrow] Graphics [arrow] Pie chartThe Pie Chart window appears.

    Pie Chart Window

    [Pie Chart Window]

  2. Use the Table button to select the CLASS table.

  3. Use the Chart column button to select AGE as the column you want the pie to represent.

  4. Select 2D if it is not already selected.

  5. 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.

  6. 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

  1. Select Additional options; the Additional Options window appears.

  2. 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.

  3. 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 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.

  4. Select OK to return to the Additional Options window.

  5. Select Labeling options. The Labeling Options window appears.

    Labeling Options Window

    [Labeling Options Window]

  6. 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.

  7. Select OK to return to the Additional Options window.

  8. Select General slice options. The General Slice Options window appears.

    General Slice Options Window

    [General Slice Options Window]

  9. Select Use automatic heading to generate an automatic title for the chart.

  10. 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

    [Explode a Pie Slice]

  11. In the Midpoint value field, type

    13

    and select OK.

  12. Select OK and then Goback to return to the Pie Chart window.


Running the Pie Chart

  1. Follow this selection path:Run [arrow] SubmitThe pie chart appears in the GRAPH window.

    Pie Chart Output

    [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 previously selected 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 bar chart created in the previous section. To delete the title, from the Pie Chart window select Edit, Titles, and then Reset.  [cautionend]

  2. To return to SAS/ASSIST software from the GRAPH window, follow this selection path: File [arrow] Close


Other Pie Chart Options


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

[Three-dimensional Pie Chart Output]

Donut Pie Chart Output

[Donut Pie Chart Output]

Star 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

Previous Page | Next Page | Top of Page