SAS Institute. The Power to Know

SAS/GRAPH(R) 9.2: Graph Template Language Reference

Previous | Next
Overview

The DATAPANEL Layout

The DATAPANEL layout is a data-driven layout that creates a grid of plots based on one or more classification variables and a graphical prototype. A separate instance of the prototype cell is created for each crossing of the classifiers. Each prototype's data are a subset of all the data that are based on the current classification level(s).

In the following example,

  • The number of cells in the grid is determined by the number of unique values of the classification variables COUNTRY and YEAR.
  • The cells are filled based on the order in which the classifiers are declared, a grid dimension, and a wrapping order.
  
 proc template; 
   define statgraph datapanel; 
     begingraph; 
       entrytitle "Annual Furniture Sales Comparisons"; 
       layout datapanel classvars=(country year) / 
         columns=4 rows=3 rowdatarange=union 
         headerlabeldisplay=value 
         headerbackgroundcolor=GraphAltBlock:color 
         rowaxisopts=(display=(tickvalues) griddisplay=on 
           linearopts=(tickvalueformat=dollar12.)) 
         columnaxisopts=(display=(tickvalues) 
           timeopts=(tickvalueformat=monname3.)); 
         layout prototype / cycleattrs=true; 
           seriesplot x=month y=TotalActual / name="Actual"; 
           seriesplot x=month y=TotalPredict / name="Predict"; 
         endlayout; 
         sidebar / align=top; 
           discretelegend "Actual" "Predict" / border=false; 
         endsidebar; 
       endlayout; 
     endgraph; 
   end; 
 run;
 

layoutdatapanel image

Previous | Next | Top of Page