Previous Page | Next Page

The CHART Procedure

Example 2: Producing a Percentage Bar Chart


Procedure features:

VBAR statement option:

TYPE=

Data set: SHIRTS

This example produces a vertical bar chart. The chart statistic is the percentage for each category of the total number of shirts sold.


Program

 Note about code
options nodate pageno=1 linesize=80 pagesize=60;
 Note about code
proc chart data=shirts;
   vbar size / type=percent;
 Note about code
   title 'Percentage of Total Sales for Each Shirt Size';
run;

Output: Listing

 Note about figure
                 Percentage of Total Sales for Each Shirt Size                 1

                Percentage

                   |                   *****
                   |                   *****
                40 +                   *****
                   |                   *****
                   |                   *****
                   |                   *****
                   |                   *****
                35 +       *****       *****
                   |       *****       *****
                   |       *****       *****
                   |       *****       *****
                   |       *****       *****
                30 +       *****       *****
                   |       *****       *****
                   |       *****       *****
                   |       *****       *****
                   |       *****       *****
                25 +       *****       *****
                   |       *****       *****
                   |       *****       *****       *****
                   |       *****       *****       *****
                   |       *****       *****       *****
                20 +       *****       *****       *****
                   |       *****       *****       *****
                   |       *****       *****       *****
                   |       *****       *****       *****
                   |       *****       *****       *****
                15 +       *****       *****       *****
                   |       *****       *****       *****
                   |       *****       *****       *****
                   |       *****       *****       *****
                   |       *****       *****       *****
                10 +       *****       *****       *****
                   |       *****       *****       *****
                   |       *****       *****       *****
                   |       *****       *****       *****
                   |       *****       *****       *****
                 5 +       *****       *****       *****
                   |       *****       *****       *****
                   |       *****       *****       *****
                   |       *****       *****       *****
                   |       *****       *****       *****
                   --------------------------------------------
                           large      medium       small

                                       Size

Previous Page | Next Page | Top of Page