Previous Page | Next Page

The GCHART Procedure

Example 7: Specifying the Sum Statistic for a Pie Chart


Procedure features:

PIE statement options:

SUMVAR=

PIE3D statement options:

EXPLODE=

SUMVAR=

Other features:

GOPTIONS statement option:

BORDER

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;
datalines;
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;
run;
 Note about code
   footnote j=r "GCHPISUM(b)";
 Note about code
   pie3d site / sumvar=sales
explode="Paris";
run;
quit;

Previous Page | Next Page | Top of Page