Previous Page | Next Page

The GCHART Procedure

Example 3: Specifying the Sum Statistic in Bar Charts


Procedure features:

HBAR statement options:

SUMVAR=

VBAR3D statement options:

SUMVAR=

Other features:

FORMAT statement

GOPTIONS statement option:

BORDER

RUN-group processing

Sample library member: GCHBRSUM

[GCHBRSUM(a)-Horizontal Bar chart with SUM statistic]

This example produces two bar charts that show the 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.

In the horizontal bar chart shown above, the summary statistics are printed by default to the right of the bars and display the formatted values of SALES.

The output also shows the frame that is drawn by default around the axis area.

The second bar chart is a three-dimensional vertical bar chart, shown in the following output. Vertical bar charts do not generate a table of statistics and by default do not print any chart statistics.

[GCHBRSUM(b)-Vertical bar chart with 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
title1 "Total Sales"; 
footnote1 j=r "GCHBRSUM(a)"; 
 Note about code
proc gchart data=totals;
format sales dollar8.;
hbar site / sumvar=sales;
run;
 Note about code
  vbar3d site / sumvar=sales;
footnote1 j=r "GCHBRSUM(b)";
run;
quit;

Previous Page | Next Page | Top of Page