Using Options to Override Style Attributes
Options That Override Attributes for Individual Plots
Overview of Graphical Properties
In GTL, the syntax for explicitly setting the properties of a graphical feature is a list of
name-value pairs that is enclosed in parentheses. For example, to set the X-axis
properties, you use the following option in the layout statement:
XAXISOPTS=(LABEL="string" TYPE=axis-type …)
The syntax for setting appearance options is similar. For example, in statements such as
SERIESPLOT, DENSITYPLOT, REFERENCELINE, and DROPLINE, you use the
LINEATTRS= option to specify the appearance of the line:
LINEATTRS= (COLOR=color PATTERN=line-pattern THICKNESS=line-thickness)
Using Options to Override Style Attributes 445
The properties of any line that you can draw in GTL are specified in exactly the same
way, possibly with a different option keyword.
In BANDPLOT and MODELBAND statements, you use the following option to specify
the appearance of the outline:
OUTLINEATTRS=(COLOR=color PATTERN=line-pattern THICKNESS=line-thickness)
In a BOXPLOT statement, you use the following options to specify the appearance of
the whiskers and median:
WHISKERATTRS=(COLOR=color PATTERN=line-pattern THICKNESS=line-thickness)
MEDIANATTRS=(COLOR=color PATTERN=line-pattern THICKNESS=line-thickness)
In BARCHART and BARCHARTPARM statements, you use the following options to
specify the appearance of the bar fill color and pattern:
FILLATTRS=(COLOR=color TRANSPARENCY=number)
FILLPATTERNATTRS=(COLOR=color PATTERN=pattern)
The list of properties in each of these options is sometimes called an "attribute bundle."
Some GTL statements provide other options that override the visual attributes of
graphical features for an individual graph. For more information, see SAS Graph
Template Language: Reference. The remainder of this section describes the most
commonly used options.
LINEATTRS Option
The following syntax is the complete syntax for the LINEATTRS= option:
LINEATTRS = style-element | style-element (line-options) | (line-options)
For information about the attributes that you can specify with line-options, see “Line
Options” on page 585.
By default, a style-element is used for the LINEATTRS= setting. For the
REFERENCELINE and DROPLINE statements, the default style element is the
GraphReference element. What exactly does this mean?
If we look up the GraphReference element in the DEFAULT style (see Appendix 2,
“Graph Style Elements Used by ODS Graphics,” on page 569 for a complete list of all
elements and attributes and their defaults), we find the following:
style GraphReference /
linethickness = 1px
linestyle = 1
contrastcolor = GraphColors('greferencelines');
This definition is ODS style syntax for an attribute bundle. The following table shows
how this definition's style attributes map to GTL options.
Style Attribute Description GTL Suboption Description
LINETHICKNESS dimension, most
often pixels
THICKNESS dimension, most
often pixels
446 Chapter 23 Managing Your Graph’s Appearance

Get SAS 9.4 Graph Template Language, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.