Previous Page | Next Page

The CHART Procedure

Example 3: Subdividing the Bars into Categories


Procedure features:

VBAR statement options:

SUBGROUP=

SUMVAR=


This example


Program

 Note about code
options nodate pageno=1 linesize=80 pagesize=60;
 Note about code
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
;
 Note about code
proc chart data=piesales;
   vbar flavor / subgroup=bakery
 Note about code
                 sumvar=pies_sold;
 Note about code
   title 'Pie Sales by Flavor Subdivided by Bakery Location';
run;

Output: Listing

 Note about figure
               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

Previous Page | Next Page | Top of Page