Previous Page | Next Page

The GCHART Procedure

Example 4: Subgrouping a Three-Dimensional Vertical Bar Chart


Procedure features:

VBAR statement options:

CFRAME=

INSIDE=SUBPCT

LEGEND=

MAXIS=

OUTSIDE=SUM

RAXIS=

SPACE=

SUBGROUP=

WIDTH=

Other features:

AXIS statement

FORMAT statement

GOPTIONS statement option:

BORDER

LEGEND statement

Sample library member: GCHBRGRP

[GCHBRGRP-3D vertical bar chart with subgrouping]

This example subgroups by department the three-dimensional vertical bar chart of total sales for each site that is shown in Specifying the Sum Statistic in Bar Charts. In addition to subdividing the bars to show the amount of sales for each department for each site, the chart displays statistics both inside and outside of the bars. OUTSIDE=SUM prints the total sales for the site above each bar. INSIDE=SUBPCT prints the percent each department contributed to the total sales for its site inside of each subgroup segment.

Both the LEGEND statement and the AXIS statement use the ORIGIN= option to line up the legend and the chart by explicitly positioning their lower left corners.

 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
Tools Paris 4 1775.74
Tools Atlanta 4 3424.19
Repairs Sydney 2 5543.97
Repairs Paris 3 6914.25
;
 Note about code
title1 "Total Sales by Site";
footnote1 j=r "GCHBRGRP "; 
 Note about code
axis1 label=none
origin=(24,);
 Note about code
axis2 label=none
order=(0 to 30000 by 5000)
minor=(number=1)
offset=(,0);
 Note about code
legend1 label=none
shape=bar(3,3)
cborder=black
origin=(24,);
 Note about code
proc gchart data=totals;
format quarter roman.;
format sales dollar8.;
vbar3d site / sumvar=sales subgroup=dept inside=subpct
     outside=sum
     width=9
     space=4
     maxis=axis1
     raxis=axis2
     cframe=gray
     legend=legend1;
run;
quit;

Previous Page | Next Page | Top of Page