![]() | ![]() | ![]() | ![]() |
/* This program uses proc format to reorder the stacked bars of */
/* a vbar chart. By default the order of the stacked bars is */
/* alpha order based on the values of the subgroup variable going */
/* from bottom to top. The legend will show the formatted values. */
goptions reset=all cback=white;
data sample;
input mid sub $;
datalines;
100 A
100 B
100 B
100 C
100 C
100 C
200 A
200 B
200 B
200 C
200 C
200 C
300 A
300 B
300 B
300 C
300 C
300 C
;
proc sort data=sample out=new;
by descending sub;
run;
data ranked;
set new;
by descending sub;
if first.sub then rank+1;
run;
proc format;
value ranked 1='C' 2='B' 3='A';
run;
proc gchart data=ranked;
vbar mid / discrete subgroup=rank;
format rank ranked.;
run;
quit;| Type: | Sample |
| Topic: | SAS Reference ==> Procedures ==> GCHART Query and Reporting ==> Creating Reports ==> Graphical ==> Graph Elements ==> Patterns |
| Date Modified: | 2005-08-24 16:06:28 |
| Date Created: | 2004-11-11 11:07:54 |
| Product Family | Product | Host | SAS Release | |
| Starting | Ending | |||
| SAS System | SAS/GRAPH | All | n/a | n/a |




