Chapter Contents |
Previous |
Next |
The GCHART Procedure |
Procedure features: |
| |||||||||||||||||
Other features: |
| |||||||||||||||||
Data set: | TOTALS | |||||||||||||||||
Sample library member: | GR13N02 |
The program groups the chart data (sites) by department, and subgroups department sales data by quarter. Each site is a midpoint. Because the sites are grouped by department, each midpoint has a separate square for each department and the height of the block represents total sales for that department.
The blocks are subgrouped to show how quarterly sales contribute to total sales; each segment represents sales for a quarter. A legend explaining the subgroup patterns appears below the midpoint grid.
The subgroups use four default patterns, The first three patterns are created by rotating the first default fill, solid, through the three colors in the colors list defined in the GOPTIONS statement. The fourth default pattern is created by using the second default pattern fill, X1, with the first color in the colors list, blue.
Because the first color in the colors list is also the default color for several other elements, the program includes several options that override the default: CTEXT= colors all text, CAXIS= colors the midpoint grid, COUTLINE= colors the pattern outline. For more information on patterns and colors, see Controlling Block Chart Patterns and Colors.
libname reflib 'SAS-data-library'; goptions reset=global gunit=pct border cback=white colors=(blue green red) ctext=black ftitle=swissb ftext=swiss htitle=4 htext=3; |
title 'Average Sales by Department'; footnote j=r 'GR13N02 '; |
legend1 cborder=black label=('Quarter:') position=(middle left outside) mode=protect across=1; |
proc gchart data=reflib.totals; format quarter roman.; format sales dollar8.; label site='00'x dept='00'x; |
block site / sumvar=sales type=mean midpoints='Sydney' 'Atlanta' group=dept subgroup=quarter legend=legend1 noheading coutline=black caxis=black; run; quit; |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.