Previous Page | Next Page

The GCHART Procedure

Example 7: Specifying the Sum Statistic for a Pie Chart

Procedure features:

PIE statement options:


PIE3D statement options:



Other features:

GOPTIONS statement option:


FORMAT statement

RUN-group processing

Sample library member: GCHPISUM

[GCHPISUM-Specifying the SUM statistic for a PIE chart]

This example produces two pie charts that show total sales for three sites by charting the values of the character variable SITE and calculating the sum of the variable SALES for each site. It represents the statistics as slices of the pie. By default, the midpoint value and the summary statistic are printed beside each slice.

The pie slices use the default pattern fill, which is solid. Each slice displays a different color because, by default, pie charts are patterned by midpoint.

The second pie chart is a three-dimensional pie chart with an exploded slice, as shown in the following output.

[GCHPISUM-3D Pie showing SUM statistic]

 Note about code
goptions reset=all border;
 Note about code
data totals;
length dept $ 7 site $ 8;
input dept site quarter sales;
Parts Sydney 1 7043.97
Parts Atlanta 1 8225.26
Parts Paris 1 5543.97
Tools Sydney 4 1775.74
Tools Atlanta 4 3424.19
Tools Paris 4 6914.25
 Note about code
title "Total Sales";
footnote j=r "GCHPISUM(a) ";
 Note about code
proc gchart data=totals;
format sales dollar8.;
pie site / sumvar=sales;
 Note about code
   footnote j=r "GCHPISUM(b)";
 Note about code
   pie3d site / sumvar=sales

Previous Page | Next Page | Top of Page