SAS Institute. The Power to Know

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

Previous | Next
Overview

The DATALATTICE Layout

The DATALATTICE layout is similar to DATAPANEL, but it requires a row classifier, a column classifier, or both.

In the following example,

  • The number of unique values of the row classifier COUNTRY determines the number of rows in the grid.
  • The number of unique values of the column classifier YEAR determines the number of columns in the grid.
  
 proc template; 
   define statgraph datalattice; 
     begingraph; 
       entrytitle "Annual Furniture Sales Comparisons"; 
       layout datalattice rowvar=country columnvar=year / 
         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=bottom; 
           discretelegend "Actual" "Predict" / border=false; 
         endsidebar; 
       endlayout; 
     endgraph; 
   end; 
 run;
 

layoutdatalattice image

In a DATALATTICE layout, the labels for the classification levels can be set to appear outside or inside the grid.

Previous | Next | Top of Page