SGPANEL Procedure

Example 3: Creating a Panel of Bar Charts

Features:

HBAR statement

Sample library member: SGPNBAR
This example shows a panel of bar charts. The COLUMNS= option in the PANELBY statement specifies that the panel contains a single column of cells.

Output

Panel of Bar Charts

Program

proc sgpanel data=sashelp.prdsale;
  title "Yearly Sales by Product";
  panelby year / novarname columns=1;
  hbar product / response=actual;
run;
title;

Program Description

Create the panel and set the title.
proc sgpanel data=sashelp.prdsale;
  title "Yearly Sales by Product";
Specify the classification variable for the panel. The NOVARNAME option specifies that the variable name is not shown in the heading for each cell. The COLUMNS= option specifies the number of columns in the panel.
  panelby year / novarname columns=1;
Create the horizontal bar chart. The RESPONSE= option specifies the response variable for the chart.
  hbar product / response=actual;
run;
Cancel the title.
title;