Sample 24869: Reflect contribution of the midpoint to the group
This sample program uses the G100 option on the VBAR/HBAR statement with PROC GCHART to have the individual percentages reflect the contribution of the midpoint to the group and total 100 percent for each group.
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
This program uses the G100 option on the VBAR/HBAR statement with PROC GCHART to have the individual percentages reflect the contribution of the midpoint to the group and total 100 percent for each group.
The graphics output in the Results tab was produced using SASĀ® 9.2.
Submitting the sample code with releases of SAS prior to SAS 9.2 might produce different results.
/* Set the graphics environment */
goptions reset=all cback=white border htitle=12pt;
/* Create input data set, TOTALS */
data totals;
input Category $ Week $;
datalines;
A Week1
A Week1
A Week1
B Week1
A Week2
A Week2
A Week2
A Week2
B Week2
B Week2
A Week3
A Week3
A Week3
A Week3
A Week3
A Week3
A Week3
B Week3
B Week3
;
run;
/* Create axis definitions */
axis1 value=none label=none;
axis2 minor=none;
axis3 label=none;
/* Add a title to the graph */
title1 'Weekly Percentages';
/* Produce the chart */
proc gchart data=totals;
vbar week / noframe type=pct subgroup=category
g100 group=week
nozero gaxis=axis1
raxis=axis2 maxis=axis3;
run;
quit;
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
This program uses the G100 VBAR/HBAR option which causes the individual percentages to reflect the contribution of the midpoint to the group and total 100 percent for each group.
Type: | Sample |
Topic: | SAS Reference ==> Procedures ==> GCHART Query and Reporting ==> Creating Reports ==> Graphical ==> Graph Types ==> Charts ==> Bar
|
Date Modified: | 2010-02-03 09:55:21 |
Date Created: | 2004-11-11 11:07:53 |
Operating System and Release Information
SAS System | SAS/GRAPH | All | n/a | n/a |