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

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.

 `goptions reset=all border;`
 ```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 ;```
 ```title1 "Total Sales by Site"; footnote1 j=r "GCHBRGRP "; ```
 ```axis1 label=none origin=(24,);```
 ```axis2 label=none order=(0 to 30000 by 5000) minor=(number=1) offset=(,0);```
 ```legend1 label=none shape=bar(3,3) cborder=black origin=(24,);```
 ```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