4
• gsfname=chrt1 GSF stands for Graphics Stream File. The argument points to an .emf file that can be inserted
into PowerPoint or WORD. The same graph can be viewed in the Graphics Window of the enhanced editor by
double-clicking on GCHART output listed in the RESULTS window.
• device=emf for Enhanced Windows Metafile is a device driver that is supported in SAS. EMF uses a vector
format that produces a high-resolution graphic that can be resized without loss in quality [16],p.4. Raster or
bitmap graphs such as Playfair.jpg displayed in Figure 2 are pixel-based which means the picture will degrade
when it is enlarged.
• gunit=pct specifies the default unit of measure used with height specifications. Choices include CELLS (de-
fault), CM (centimeters), IN (inches), PCT (percentage of graphics output area), and PT (points).
[14], p.350.
• rotate=landscape the graph's width is greater than its height.
• ftext="Arial" sets the font for all text in the graph. The argument is device dependent.
• htext=13pt htitle=15pt sets the default text and TITLE1 heights. A second GOPTIONS statement includes the
HTEXT, HTITLE and GSFNAME clauses so that they can be altered for each graph that is generated in a
multi-graph program. The changes made to the second GOPTIONS statement have no effect on the first.
GOPTIONS statements do not appear elsewhere in the paper, but they can be found in the unabridged program on the
NESUG CD. Code lines of lesser significance are also grayed out, and titles are diminished in size in the examples that follow.
Generating an Enhanced FREQ Chart (default TYPE)
Let's enhance the response axis (vertical RAXIS) with an axis statement that emboldens and rotates the label,
assigns a meaningful number of minor ticks (1), and provides a range (0 to 14 by 2) that coincidentally leaves
enough space for individual frequencies to be printed on top of the bars. In Figure 4 and many of the examples
that follow, graphs are clipped and enlarged in WORD to make them more readable
(Format>Picture>Picture>Crop
from> and Format>Picture>Size).
• pattern1 The pattern statement sets the color and type of fill for all areas in a graph. The default type for a pat-
tern fill is SOLID. Other options such as EMPTY and slanted hatch marks are also available. Because
PATTERNID is not specified as a GCHART option, all the bars are colored the same. Also, while there is a
COUTLINE option in GCHART, CBAR for assigning a uniform color to the bars doesn't exist.
• axis1 The label for the response axis is rotated (a=90), and emboldened (f="Arial/bold"), provided with 1 minor
tick mark that references an integer (n=1), and given a more expansive range (0 to 14 by 2). Note that AXIS1
is linked to PROC GCHART via the RAXIS option. For the label, formatting clauses (a= f=) must precede text
assignments or they won't take effect.
• outside=freq displays the specified statistic (in this case FREQ) above the bar. The size of the text is the
same as that used for the axis values, namely 13pt from GOPTIONS. This can become a problem when lots of
bars are being displayed in a graph.
• coutline=black woutline=1 the bars are set off with a black outline that is one pixel wide.
Generating Percent, Mean, and Sum Bar Charts
Few revisions are needed to go from the frequency chart depicted in Figure 4 to the percent, mean, and sum bar
charts displayed in Figure 5. Repeated commands and titles are being removed from the code panel in Figure 5
to conserve space.
Figure 4. An enhanced FREQ chart.
Count of Meetings by Department
(FREQ Chart Enhanced)
8
11
13
Number of Meetings
0
2
4
6
8
10
12
14
Department
ACCOUNTS MARKET SHIP
pattern1 color=grayCC;
axis1 label=(a=90 f="Arial/Bold"
"Number of Meetings") minor=(n=1)
order=(0 to 14 by 2);
axis2 label=
(f="Arial/Bold" "Department");
title1
"Count of Meetings by Department";
title2 '(FREQ Chart Enhanced)';
proc gchart data=N07.meetings;
vbar dept /
width=15
outside=freq
raxis=axis1
maxis=axis2
coutline=black
woutline=1;
run;
quit;
Foundations & FundamentalsNESUG 2007