Creating Bar and Pie Charts |
Specifying the Chart Type and
Variables |
After you invoke the GCHART procedure and specify the data
set to use, you specify
Whether the chart variable is character or numeric determines the number of bar or pie slices in your chart.
PROC GCHART creates one bar or pie slice for each unique value
of a character variable. For example, the HBAR statement below specifies
a horizontal bar chart of the character variable proc gchart data=clinic.admit; hbar sex; run; |
Numeric Chart
Variables
Unless otherwise specified, SAS/GRAPH software assumes that all numeric variables are continuous. SAS/GRAPH software automatically determines intervals for continuous variables and creates one bar or pie slice for each interval. The intervals are identified by their midpoint values.
In the program below, the VBAR statement specifies a vertical bar chart
of the numeric variable proc gchart data=clinic.admit; vbar age; run; |
Copyright © 2002 SAS Institute Inc., Cary, NC, USA. All rights reserved.