| LAYOUT DATALATTICE Statement |
The following graph was generated by the "Example Program":

proc template;
define statgraph layoutdatalattice;
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;
proc summary data=sashelp.prdsal2 nway;
class country year month;
var actual predict;
output out=prdsal2 sum=TotalActual TotalPredict;
run;
proc sgrender data=prdsal2 template=layoutdatalattice;
run;
By default, the number of cells in the layout is determined by the number of value pairings that are possible for the classification values plus any empty cells needed to complete the last row/column of the grid. The contents of each data cell are based on a graph prototype that you specify in the graph-prototype-block . Optionally, you can enhance the display using one or more sidebar-statement-blocks . For classification variables that have many values, you can use the COLUMNS= and/or ROWS= options and the PANELNUMBER= option to generate multiple panel displays.
Classification variables for the layout are specified on the ROWVAR= argument (to specify a row variable), or the COLUMNVAR= argument (to specify a column variable), or both arguments to specify both a column and a row variable. The graph prototype for each data cell's contents is specified within a LAYOUT PROTOTYPE block, and sidebars are specified within SIDEBAR blocks. The LAYOUT PROTOTYPE and SIDEBAR blocks are nested within the LAYOUT DATALATTICE block.
By default, the first data cell to be filled is in the layout's top-left corner. Use the START= option to change the starting data cell to the bottom-left corner.
Rather than display the header labels outside the grid, you can set HEADERLABELLOCATION=INSIDE to display them inside the grid, as shown in the following figure:

Note: The DATALATTICE layout is designed to be the outermost layout in the template.
Copyright © 2007 by SAS Institute Inc., Cary, NC, USA. All rights reserved.