The following
syntax is the complete syntax for the LINEATTRS= option:
LINEATTRS = style-element | style-element (line-options) | (line-options)
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 SAS Graph Style Elements for GTL 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.
|
|
|
|
|
dimension, most
often pixels
|
|
dimension, most
often pixels
|
|
numeric; 1 to
46, 1 being a solid line
|
|
either 1 to 46
or a pattern name, such as SOLID, DASH, DOT ( see Values for Line Patterns for examples
of available line patterns)
|
|
|
|
|
The default
specification for REFERENCELINE and DROPLINE statements is
LINEATTRS=GraphReference
, which is a shortcut meaning
"initialize the three GTL line properties with the corresponding attributes
that are defined in a style element." This can be explicitly expressed
in GTL as follows:
LINEATTRS=( PATTERN = GraphReference:LineStyle
THICKNESS= GraphReference:LineThickness
COLOR = GraphReference:ContrastColor )
In GTL,
a style reference is a construct of the form
style-element :
style-attribute. This
convention is the way to refer to a specific style attribute of a
specific style element.
First
of all, let's look at what it means to use a different style element
for the LINEATTRS= option.
When selecting
a different style element, you should make sure that the style element
does set line properties (graph style elements do not necessarily
define all possible attributes). Some reasonable choices might be
GraphDataDefault, GraphAxisLines, GraphGridLines. and GraphBorderLines.
You might choose GraphGridLines to force a reference line to match
the properties of grid lines (if displayed). When you make this kind
of assignment, you really don't know what actual line properties will
be used because they might change, depending on how a given style
is defined. What you should be confident of is that the grid lines
and reference lines will be identical in terms of line properties.
Now let's
assume that you want reference lines to be somewhat like a style element,
but nevertheless different. This involves an override. Here are some
examples:
1) LINEATTRS=GraphGridLines(THICKNESS=2px)
2) LINEATTRS=GraphAxisLines(PATTERN=DASH)
3) LINEATTRS=GraphReference(COLOR=GraphAxisLines:ContrastColor)
4) LINEATTRS=(COLOR=GraphAxisLines:ContrastColor)
5) LINEATTRS=(COLOR=BLUE)
In example
1, the reference line will look like a grid line (color and pattern),
but be thicker (assuming most styles define grid lines as 1px).
In example
2, the reference line will look like an axis line (color and thickness),
but it will use the DASH pattern.
In example
3, the reference line will look like a reference line (pattern and
thickness), but it will have the color of axis lines.
Example
4 is a short form for example 3. Any time that you don't supply a
style element or don’t override all the sub-options, the sub-options
not overridden come from the default style references.
Example
5 shows how you can "hard-code" visual properties. This technique
is a straightforward way of getting what you want. The results might
look good when the DEFAULT or LISTING styles are in effect, but might
not look good when the ANALYSIS style is in effect because ANALYSIS
does not use any blues in its color scheme.
When specifying
the attributes for a line, the available
line-options can be any one or more of the following settings. The options must
be enclosed in parentheses, and each option is specified as a
name =
value pair. In all cases, the value can be a
style-reference in the form
style-element:
style-attribute (see Example
3).
COLOR=
style-reference |
color
specifies the line
color. If you use a style-reference, the style-attribute should
be a valid attribute, such as COLOR, CONTRASTCOLOR, STARTCOLOR, NEUTRAL,
or ENDCOLOR. The convention is to use CONTRASTCOLOR for lines.
PATTERN=
style-reference |
line-pattern-name |
line-pattern-number
specifies the line
pattern. If you use a
style-reference, the
style-attribute should
be LINESTYLE. Line patterns can be specified as a pattern name or
pattern number.
See Values for Marker Symbols and Line Patterns for a list
of all possible line patterns.
THICKNESS=
style-reference |
dimension
specifies the line
thickness. If you use a style-reference, the style-attribute should
be LINETHICKNESS.