| Procedure features: |
|
VBAR statement options:
|
CFRAME= |
|
INSIDE=SUBPCT |
|
LEGEND= |
|
MAXIS= |
|
OUTSIDE=SUM |
|
RAXIS= |
|
SPACE= |
|
SUBGROUP= |
|
WIDTH= | |
|
| Other features: |
|
AXIS statement |
|
FORMAT statement |
|
GOPTIONS statement
|
|
LEGEND statement |
|
PATTERN
statement |
|
| Data set: |
TOTALS
|
| Sample library member: |
GCHBRGRP
|
![[GCHBRGRP-3D vertical bar chart with subgrouping]](./images/gr13n04.gif)
This example subgroups by department the 3D 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.
The legend has a block-effect shadow whose color matches
the backplane. The graphics option OFFSHADOW= defines the size and position
of the block shadow. 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.
 |
libname reflib 'SAS-data-library';
goptions reset=global gunit=pct border cback=white
colors=(black red green blue) ftitle=swissb
ftext=swiss htitle=6 htext=4
offshadow=(1.5,1.5); |
 |
title1 'Total Sales by Site';
footnote1 h=3 j=r 'GCHBRGRP '; |
 |
axis1 label=none
origin=(24,); |
 |
axis2 label=none
order=(0 to 100000 by 20000)
minor=(number=1)
offset=(,0); |
 |
legend1 label=none
shape=bar(3,3)
cborder=black
cblock=gray
origin=(24,); |
 |
pattern1 color=lipk;
pattern2 color=cyan;
pattern3 color=lime; |
 |
proc gchart data=reflib.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
coutline=black
legend=legend1;
run;
quit; |
Copyright 2003 by SAS Institute Inc., Cary, NC, USA. All rights reserved.