Chapter Contents


The GCHART Procedure

Example 1: Specifying the Sum Statistic in a Block Chart

Procedure features:
BLOCK statement option:
Other features: FORMAT statement
Sample library member: GR13N01


This example produces a block chart of 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 prints formatted values of the sales statistics below the blocks.

The chart uses default patterns and colors. The block faces use the default pattern fill, which is solid. Because a colors list is specified in the GOPTIONS statement, the default fill color is the first color in the list, blue. The midpoint grid and the block outlines also use the first color in the list.

All the blocks use the same pattern because by default patterns change for subgroups and in this chart subgroups are not specified.
 Note about code
libname reflib 'SAS-data-library';
goptions reset=global gunit=pct border cback=white
         ctext=black colors=(blue green red)
         ftext=swiss ftitle=swissb
         htitle=6 htext=3.5;
 Note about code
data reflib.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
...more data lines...
Tools   Sydney  4 1775.74
Tools   Atlanta 4 3424.19
Tools   Paris   4 6914.25
 Note about code
title 'Total Sales';
footnote j=r 'GR13N01 ';
 Note about code
proc gchart data=reflib.totals;
   format sales dollar8.;
   block site / sumvar=sales;

Chapter Contents



Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.