Use a DRAWARROW or DRAWLINE statement
to draw an arrow or line on your graph. The basic syntax is as follows:
DRAWARROW X1=x1 Y1=y1 X2=x2 Y2=y2 / <options>
The syntax for the DRAWLINE
statement is similar.
The X1=, Y1=, X2=, and
Y2= options on the DRAWARROW and DRAWLINE statements specify the coordinates
for each endpoint of the arrow or line. By default, the coordinate
units are GRAPHPERCENT. You can include the DRAWSPACE= option, or
the X1SPACE=, Y1SPACE=, X2SPACE=, and Y2SPACE= options in
options to specify different units. If you specify
DATAVALUE as the units and you want to scale your arrow or line to
the secondary axis, you must also include the X1AXIS=X2, Y1AXIS=Y2,
X2AXIS=X2, and Y2AXIS=Y2 options.
For both arrows and
lines, include the LINEATTRS= option in
options to specify the line pattern, thickness, and color. For arrows, open
arrowheads that point in the outward direction are the default. To
change the arrowhead shape, include the ARROWHEADSHAPE= option and
specify CLOSED, FILLED, or BARBED. You can also include the ARROWHEADSCALE=
option to scale the arrowhead based on the thickness of the arrow
line. The scaling factor is 1 by default. You can scale the arrowhead
from a minimum of 0.5 to a maximum of 2.
To change the arrowhead
direction, include the ARROWHEADDIRECTION= option in
options and specify IN or BOTH. The IN direction
positions the arrowhead on the (X1, Y1) endpoint and points it inward
toward the (X1, Y1) endpoint. The BOTH direction includes both IN
and OUT arrowheads forming a two-way arrow.
Here is an example of
a DRAWARROW statement that adds a two-way dashed arrow.
drawarrow x1=60 y1=70 x2=190 y2=70 / drawspace=graphpixel
lineattrs=(pattern=3 thickness=1px)
arrowheadshape=barbed arrowheadscale=2 arrowheaddirection=both;
The arrow is drawn from
endpoint (60, 70) to endpoint (190, 70) in GRAPHPIXEL units as shown
in the following figure.
The LINEATTRS= option
specifies a dashed line (PATTERN=3) that is one pixel wide. The ARROWHEADSHAPE=
option specifies a barbed arrowhead, and the ARROWHEADSCALE= option
specifies a scale factor of 2 (maximum size). The ARROWHEADDIRECTION=
option specifies a two-way arrow.
To draw a line, in your
DRAWLINE statement, use the X1=, Y1=, X2=, and Y2= options to specify
the location of the endpoints. Include the LINEATTRS= option in
options to specify the line pattern, color, and
thickness. Here is the previous example modified to draw a dashed
line instead of a dashed arrow at the same coordinates.
drawline x1=60 y1=70 x2=190 y2=70 / drawspace=graphpixel
lineattrs=(pattern=3 thickness=1px);