An AXISLEGEND statement
is used to consolidate the axis display so that a large number of
tick values can be clearly displayed without collision. In an axis
legend, the legend symbol is a positive integer that is generated
to represent a specific axis tick position, and the legend value displays
the axis tick value. In the
Example Graph, the first legend symbol is the integer
1
and the first legend value is
Neon SE
4dr
.
To implement an axis
legend, all of the following requirements must be met:
-
The axis must be a discrete axis.
The axis can be discrete by default, or explicitly set to discrete
by setting TYPE=DISCRETE among the parent layout’s axis-option
settings.
-
The parent layout’s axis
options must specify NAME= to assign a name to the axis.
-
The parent layout’s axis
options must use the DISCRETEOPTS= option to specify either TICKVALUEFITPOLICY=EXTRACT
or TICKVALUEFITPOLICY=EXTRACTALWAYS. EXTRACT implements an axis legend
if the system estimates that a collision might occur. EXTRACTALWAYS
implements an axis legend regardless of whether a collision occurs.
-
The AXISLEGEND statement must reference
the axis name that was specified in the parent layout’s NAME=
axis option.
When all of these requirements
are satisfied, the tick values of the named discrete axis can be replaced
with consecutive positive integers. The axis legend displays those
integer values and the corresponding tick values that the integers
represent.
Within an overlay-type
layout, when an axis legend is placed inside the plot area with
LOCATION=INSIDE,
-
The axis legend is always placed
on top of plot lines and markers.
-
By default, its background is fully
transparent (
OPAQUE=FALSE), meaning that underlying lines,
markers, and data labels show through the legend.
-
Within an overlay-type
layout, when an axis legend is placed outside the plot area with LOCATION=OUTSIDE,
-
By default, its background is fully
opaque (OPAQUE=TRUE).
-
Its position can be controlled
with the HALIGN= and VALIGN= options.
When an axis legend
is placed within nested layouts, it might be necessary to do one of
the following to obtain the desired legend organization:
-
-
use the
DOWN= option and also set ORDER= COLUMNMAJOR
A legend might be dropped
if the total legend area in the graph exceeds the percentage that
is set by the MAXLEGENDAREA= option in an ODS GRAPHICS statement that
is in effect for the output destination. A legend might also be dropped
if
DISPLAYCLIPPED=FALSE and the full legend cannot be
displayed.