Example Program and Statement Details

Example Graph

The following graph was generated by the Example Program:
Example Graph in Layout Overlay

Example Program

proc template;
  define statgraph layoutoverlay;
    begingraph;
      entrytitle "Trends in Employment Levels";
      layout overlay / cycleattrs=true
         xaxisopts=(display=(ticks tickvalues))
         yaxisopts=(label="Number of Workers (thousands)");
        seriesplot x=date y=electric /
         curvelabel="Electrical"
         curvelabellocation=outside;
        seriesplot x=date y=masonry / curvelabel="Masonry" 
         curvelabellocation=outside;
      endlayout;
    endgraph;
  end;
run;
proc sgrender data=sashelp.workers template=layoutoverlay;
run;

Statement Summary

The LAYOUT OVERLAY statement builds a composite using one or more GTL-statements. You can specify one or more 2-D plots within the layout, provided all plots can share the same type of axes. You can also specify one or more insets, such as nested layout statements (for example, LAYOUT GRIDDED), ENTRY statements, and legend statements (CONTINUOUSLEGEND or DISCRETELEGEND).
The following general logic applies to rendering the composite:
  • All plot statements are rendered first. Plot statement results are always rendered in the plot area. The plots are stacked on top of one another in the order in which they are specified, with the last one on top. It is possible for one plot’s graphical data to obscure graphical data beneath it. You can control this by selectively ordering the plot statements, or by using transparency on the individual plots, or by doing both.
  • The insets are rendered next, in the order in which they are specified. As with the plot statements, it is possible for the insets to obscure the results of other statements in the layout.
  • To control the horizontal and vertical positioning of an inset, use the inset statement’s AUTOALIGN= option, or its HALIGN= and VALIGN= options. Each nested inset determines its own relative position in the parent OVERLAY.
  • Some insets, like legends, can be positioned inside or outside of the plot area using the inset statement’s LOCATION= option. The inset’s AUTOALIGN= or HALIGN= and VALIGN= settings are then relative to that location.
Generally, the first specified plot determines the layout’s default axis characteristics. To enable another plot to define the axis characteristics, set PRIMARY=TRUE for that plot. For more information about the default axis characteristics, see When Plots Share Data and a Common Axis.
See Also: LAYOUT OVERLAYEQUATED and LAYOUT OVERLAY3D.
Graph with a Block Plot Displayed at the Bottom

Options

Statement Option
Description
Specifies the color of the layout background.
Specifies whether a border is drawn around the layout.
Specifies the properties of the border line.
Specifies whether the default visual attributes of markers, lines, and fills in nested plot statements automatically change from plot to plot.
Specifies whether the layout background is opaque.
Specifies the amount of extra space that is added inside the layout border.
Specifies the fill color of the plot wall area.
Specifies whether the plot’s wall and wall outline are displayed.
Specifies one or more X axis options.
Specifies one or more X2 axis options.
Specifies one or more Y axis options.
Specifies one or more Y2 axis options.
BACKGROUNDCOLOR=style-reference | color
specifies the color of the layout background.
Default: The GraphBackground:Color style reference.
style-reference
A reference in the form style-element:style-attribute. Only the style-attribute named COLOR is used.
Interaction: OPAQUE=TRUE must be in effect for the color to be seen. By default, OPAQUE=FALSE.
BORDER=boolean
specifies whether a border is drawn around the layout.
Default: FALSE
BORDERATTRS=style-element | style-element (line-options) | (line-options)
specifies the attributes of the border line around the layout. See General Syntax for Attribute Options for the syntax on using a style-element and Line Options for available line-options.
Default: The GraphBorderLines style element.
Interaction: BORDER=TRUE must be set for this option to have any effect.
CYCLEATTRS=boolean
specifies whether the default visual attributes of markers, lines, and fills in nested plot statements automatically change from plot to plot. See Cycling Through Group Attributes in Overlaid Plots for more information.
Default: FALSE
FALSE
does not cycle the default visual attributes of multiple plots. For example, if you overlay three series plots, each series line has the same default visual properties.
TRUE
the system looks at the plots in the layout and tries to use the GraphData1 - GraphDataN style elements to assign different visual properties to applicable plots (scatter plots and series plots and others). For example, if you overlay three series plots, the three series lines receive different default visual properties (line pattern and color). These default properties are determined by the next GraphDataN style element not already used. Some plots in the layout do not participate in the cycling (for example, reference lines and drop lines).
OPAQUE= boolean
specifies whether the layout background is opaque (TRUE) or transparent (FALSE).
Default: FALSE
Interaction: When this option is set to FALSE, the background color is not used.
PAD=dimension | (pad-options)
specifies the amount of extra space that is added inside the layout border.
Default: The default padding for all sides is 0. Values without units are in pixels (px). A unit must be provided if other than pixels.
dimension
Specifies a dimension to use for the extra space at the left, right, top, and bottom of the layout border.
(pad-options)
Enables separate settings for the left, right, top, and bottom padding dimensions. Use the pad-options to create non-uniform padding. These options must be enclosed in parentheses. Each option is specified as a name = value pair. Sides not assigned padding are padded with the default amount.
Values without units are in pixels (px). A unit must be provided if other than pixels.
LEFT=dimension specifies the amount of extra space added to the left side.
RIGHT=dimension specifies the amount of extra space added to the right side.
TOP=dimension specifies the amount of extra space added to the top.
BOTTOM=dimension specifies the amount of extra space added to the bottom.
WALLCOLOR=style-reference | color
specifies the fill color of the plot wall area.
Default: The GraphWalls:Color style reference.
style-reference
A reference in the form style-element:style-attribute. Only the style- attribute named COLOR is used.
Interaction: This option is ignored if WALLDISPLAY=NONE or WALLDISPLAY=(OUTLINE).
WALLDISPLAY=STANDARD | ALL | NONE | (display-options)
specifies whether the plot’s wall and wall outline are displayed.
Default: STANDARD
STANDARD
Displays a filled wall. The setting of the FRAMEBORDER= ON | OFF attribute of the GraphWalls style element determines whether the wall outline is displayed.
ALL
Displays a filled, outlined wall.
NONE
Displays no wall, no wall outline.
(display-options)
These options must be enclosed in parentheses and include one of the following:
OUTLINE displays the wall outline.
FILL displays a filled wall area.
Use the WALLCOLOR= option to control the fill color of the wall.
The appearance attributes of the wall outline are set by the GraphAxisLine style element.
XAXISOPTS= ( axis-options )
specifies one or more X axis options. For a list of options, see Axis Options for LAYOUT OVERLAY.
Requirement: Axis options must be enclosed in parentheses and separated by spaces.
X2AXISOPTS= ( axis-options )
specifies one or more X2 axis options. For a list of options, see Axis Options for LAYOUT OVERLAY.
Requirement: Axis options must be enclosed in parentheses and separated by spaces.
YAXISOPTS= ( axis-options )
specifies one or more Y axis options. For a list of options, see Axis Options for LAYOUT OVERLAY.
Requirement: Axis options must be enclosed in parentheses and separated by spaces.
Y2AXISOPTS= ( axis-options )
specifies one or more Y2 axis options. For a list of options, see Axis Options for LAYOUT OVERLAY.
Requirement: Axis options must be enclosed in parentheses and separated by spaces.