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

This example also illustrates a reusable template in the sense that it works for any numeric variable specified by the dynamic variable VAR. Also, SGE functions for computing the N, MEAN, STDDEV of the variable are used in the table to compute the statistics as the template is executed.
proc template;
define statgraph inset;
dynamic VAR;
begingraph;
entrytitle "Distribution of " VAR;
layout overlay / yaxisopts=(griddisplay=on);
histogram VAR / scale=percent;
layout gridded / columns=2
autoalign=(topleft topright) border=true
opaque=true backgroundcolor=GraphWalls:color;
entry halign=left "N";
entry halign=left eval(strip(put(n(VAR),12.0)));
entry halign=left "Mean";
entry halign=left eval(strip(put(mean(VAR),12.2)));
entry halign=left "Std Dev";
entry halign=left eval(strip(put(stddev(VAR),12.2)));
endlayout;
endlayout;
endgraph;
end;
run;
proc sgrender data=sashelp.cars template=inset;
dynamic VAR="Weight";
run;
The GRIDDED layout automatically decides how much area to allocate to cell contents:
The layout's grid size is determined by the COLUMNS= and ROWS= options. The resulting columns and rows can be separated by areas called gutters , which are controlled by the COLUMNGUTTER= and ROWGUTTER= options.
By default, the results of the statgraph-statements are placed into the grid sequentially from left to right, wrapping to a new row each time the current row is filled. You can use the ORDER= option to fill cells from top to bottom down a column, in which case the layout cells wrap to a new column each time the current column is filled.
Copyright © 2007 by SAS Institute Inc., Cary, NC, USA. All rights reserved.