This example
-
produces a vertical
bar chart for categories of one variable with
bar lengths that represent the values of another variable.
-
subdivides each bar into categories based on the values of a third
variable.
|
options nodate pageno=1 linesize=80 pagesize=60; |
|
data piesales;
input Bakery $ Flavor $ Year Pies_Sold;
datalines;
Samford apple 1995 234
Samford apple 1996 288
Samford blueberry 1995 103
Samford blueberry 1996 143
Samford cherry 1995 173
Samford cherry 1996 195
Samford rhubarb 1995 26
Samford rhubarb 1996 28
Oak apple 1995 319
Oak apple 1996 371
Oak blueberry 1995 174
Oak blueberry 1996 206
Oak cherry 1995 246
Oak cherry 1996 311
Oak rhubarb 1995 51
Oak rhubarb 1996 56
Clyde apple 1995 313
Clyde apple 1996 415
Clyde blueberry 1995 177
Clyde blueberry 1996 201
Clyde cherry 1995 250
Clyde cherry 1996 328
Clyde rhubarb 1995 60
Clyde rhubarb 1996 59
; |
|
proc chart data=piesales;
vbar flavor / subgroup=bakery |
|
sumvar=pies_sold; |
|
title 'Pie Sales by Flavor Subdivided by Bakery Location';
run; |
|
Pie Sales by Flavor Subdivided by Bakery Location 1
Pies_Sold Sum
| SSSSS
| SSSSS
| SSSSS
1800 + SSSSS
| SSSSS
| SSSSS
| SSSSS
1600 + SSSSS
| SSSSS
| SSSSS SSSSS
| OOOOO SSSSS
1400 + OOOOO SSSSS
| OOOOO SSSSS
| OOOOO SSSSS
| OOOOO SSSSS
1200 + OOOOO SSSSS
| OOOOO OOOOO
| OOOOO OOOOO
| OOOOO SSSSS OOOOO
1000 + OOOOO SSSSS OOOOO
| OOOOO SSSSS OOOOO
| OOOOO SSSSS OOOOO
| OOOOO SSSSS OOOOO
800 + OOOOO OOOOO OOOOO
| CCCCC OOOOO OOOOO
| CCCCC OOOOO OOOOO
| CCCCC OOOOO OOOOO
600 + CCCCC OOOOO CCCCC
| CCCCC OOOOO CCCCC
| CCCCC OOOOO CCCCC
| CCCCC OOOOO CCCCC
400 + CCCCC CCCCC CCCCC
| CCCCC CCCCC CCCCC
| CCCCC CCCCC CCCCC
| CCCCC CCCCC CCCCC SSSSS
200 + CCCCC CCCCC CCCCC OOOOO
| CCCCC CCCCC CCCCC OOOOO
| CCCCC CCCCC CCCCC CCCCC
| CCCCC CCCCC CCCCC CCCCC
--------------------------------------------------------
apple blueberr cherry rhubarb
Flavor
Symbol Bakery Symbol Bakery Symbol Bakery
C Clyde O Oak S Samford
| |
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.