Previous Page | Next Page

The CHART Procedure

Example 5: Producing a Horizontal Bar Chart for a Subset of the Data


Procedure features:

HBAR statement options:

GROUP=

SUMVAR=

Other features:

WHERE= data set option

Data set: PIESALES

This example


Program

 Note about code
options nodate pageno=1 linesize=80 pagesize=60;
 Note about code
proc chart data=piesales(where=(year=1995));
 Note about code
   hbar bakery / group=flavor
 Note about code
   sumvar=pies_sold;
 Note about code
   title '1995 Pie Sales for Each Bakery According to Flavor';
run;

Output: Listing

               2007 Pie Sales for Each Bakery According to Flavor              1

 Flavor     Bakery                                                   Pies_Sold
                                                                           Sum
                      |
 apple      Clyde     |******************************************     313.0000
            Oak       |*******************************************    319.0000
            Samford   |*******************************                234.0000
                      |
 blueberr   Clyde     |************************                       177.0000
            Oak       |***********************                        174.0000
            Samford   |**************                                 103.0000
                      |
 cherry     Clyde     |*********************************              250.0000
            Oak       |*********************************              246.0000
            Samford   |***********************                        173.0000
                      |
 rhubarb    Clyde     |********                                        60.0000
            Oak       |*******                                         51.0000
            Samford   |***                                             26.0000
                      |
                      ----+---+---+---+---+---+---+---+---+---+---
                          30  60  90 120 150 180 210 240 270 300

                                      Pies_Sold Sum

Previous Page | Next Page | Top of Page