GDRAW functions create graphics elements. Each GDRAW operator is associated with a set of GSET operators that control its attributes. For example, the color , height, and font for the GDRAW( TEXT , ) function are controlled by GSET( TEXCOLOR , ), GSET( TEXHEIGHT , ), and GSET( TEXFONT , ), respectively. For a complete list of the attributes associated with each GDRAW function, see Table 49.2 on page 1364. The complete graph is displayed after the GRAPH( UPDATE , ) function is submitted.
When using GDRAW functions, remember the following:
All arguments must be specified.
All arguments are specified as variables or constants. If you express an argument as a variable, the variable must be initialized .
All character arguments that are expressed as character strings must be enclosed in quotes.
All character variable names used as arguments must be declared in a LENGTH statement.
All character constants must be enclosed in single or double quotes.
GDRAW functions:
ARC
BAR
ELLARC
ELLIPSE
FILL
IMAGE
LINE
MARK
MESSAGE
PIE
TEXT
Draws a circular arc
Operating States: SGOP
Return Codes: 0, 4, 61, 86
return-code-variable = GDRAW( ARC , x, y, radius, start, end );
The GDRAW( ARC , ) function draws a circular arc. The line attributes and bundles affect the appearance of this primitive. See Table 49.2 on page 1364 for a list of these attributes. Figure 50.2 on page 1447 illustrates the arguments used with GDRAW( ARC , ).
x | numeric constant or numeric variable name ; specifies the x coordinate of the position of the arc on the display; x coordinates are in units based on the current window system. |
y | numeric constant or numeric variable name; specifies the y coordinate of the position of the arc on the display; y coordinates are in units based on the current window system; |
radius | numeric constant or numeric variable name; the arc radius size is in units based on the current window system. |
start | numeric constant or numeric variable name; the starting angle of the arc is in degrees, with 0 degrees at 3 o clock. |
end | numeric constant or numeric variable name; the ending angle of the arc is in degrees, with 0 degrees at 3 o clock. |
ELLARC on page 1449
PIE on page 1455
LINCOLOR on page 1476
LININDEX on page 1477
LINREP on page 1478
LINTYPE on page 1479
LINWIDTH on page 1479
Draws a rectangle
Operating States: SGOP
Return Codes: 0, 4, 76, 79, 80, 86
return-code-variable = GDRAW( BAR , x1, y1, x2, y2 );
The GDRAW( BAR , ) function draws a rectangular bar whose sides are parallel to the sides of the display area. The fill attributes and bundles affect the appearance of this graphics element. See Table 49.2 on page 1364 for a list of these attributes. Figure 50.3 on page 1448 illustrates the arguments used with GDRAW( BAR , ).
x1 | numeric constant or numeric variable name; refers to the x coordinate of one corner of the bar. |
y1 | numeric constant or numeric variable name; refers to the y coordinate of one corner of the bar. |
x2 | numeric constant or numeric variable name; refers to the x coordinate of the corner of the bar that is diagonally opposite to the corner of ( x1 , y1 ). |
y2 | numeric constant or numeric variable name; refers to the y coordinate of the corner of the bar that is diagonally opposite to the corner of ( x1 , y1 ). |
FILL on page 1451
FILCOLOR on page 1469
FILINDEX on page 1470
FILREP on page 1470
FILTYPE on page 1473
FILSTYLE on page 1471
HTML on page 1475
Draws an elliptical arc
Operating States: SGOP
Return Codes: 0, 4, 61, 86
return-code-variable = GDRAW( ELLARC , x, y, major, minor, start, end, angle );
The GDRAW( ELLARC , ) function draws a hollow section of an ellipse. The line attributes and bundles affect the appearance of this primitive. See Table 49.2 on page 1364 for a list of these attributes. Figure 50.4 on page 1449 illustrates the arguments used with GDRAW( ELLARC , ) and GDRAW( ELLIPSE , ).
x | numeric constant or numeric variable name; x coordinates are in units based on the current window system. |
y | numeric constant or numeric variable name; y coordinates are in units based on the current window system. |
major | numeric constant or numeric variable name; the major axis lengths for the elliptical arc. |
minor | numeric constant or numeric variable name; the minor axis lengths for the elliptical arc. |
start | numeric constant or numeric variable name; the starting angle from the major axis, in degrees, for the elliptical arc with 0 degrees beginning at the major axis. |
end | numeric constant or numeric variable name; the ending angle from the major axis, in degrees, for the elliptical arc with 0 degrees at 3 o clock. |
angle | numeric constant or numeric variable name; the angle that the major axis of the elliptical arc has to 0 degrees (with 0 degrees at 3 o clock). |
ELLIPSE on page 1450
LINCOLOR on page 1476
LINTYPE on page 1479
LINWIDTH on page 1479
LINREP on page 1478
LININDEX on page 1477
Draws an ellipse
Operating States: SGOP
Return Codes: 0, 4, 76, 79, 80, 86
return-code-variable = GDRAW( ELLIPSE , x, y, major, minor, start, end, angle );
The GDRAW( ELLIPSE , ) function draws a filled section of an ellipse. The fill attributes and bundles affect the appearance of this primitive. See Table 49.2 on page 1364 for a list of these attributes. Figure 50.4 on page 1449 illustrates the arguments used with GDRAW( ELLARC , ) and GDRAW( ELLIPSE , ).
x | numeric constant or numeric variable name; the x coordinate of the position of the ellipse on the display. |
y | numeric constant or numeric variable name; the y coordinate of the position of the ellipse on the display. |
major | numeric constant or numeric variable name; the major axis length for the ellipse. |
minor | numeric constant or numeric variable name; the minor axis length for the ellipse. |
start | numeric constant or numeric variable name; the starting angle for the ellipse from the major axis, with 0 degrees beginning at the major axis. |
end | numeric constant or numeric variable name; the ending angle for the ellipse from the major axis, with 0 degrees at 3 o clock. |
angle | numeric constant or numeric variable name; the angle that the major axis of the ellipse has to 0 degrees, with 0 degrees at 3 o clock. |
ELLARC on page 1449
FILCOLOR on page 1469
FILINDEX on page 1470
FILREP on page 1470
FILTYPE on page 1473
HTML on page 1475
Draws a filled area
Operating States: SGOP
Return Codes: 0, 4, 76, 79, 80, 86, 100, 301
return-code-variable = GDRAW( FILL , n, x-values, y-values );
The GDRAW( ILL ) function draws a filled polygon. The fill attributes and bundles affect the appearance of this primitive. See Table 49.2 on page 1364 for a list of these attributes.
Note: All of the x coordinates are listed in the function first, followed by the y coordinates. This primitive takes the first n values and stores them as x coordinates. The next n values are stored as y coordinates.
n | numeric constant or numeric variable name; the number of vertices ( x and y pairs) in the polygon. You can specify a missing value (.) for n .If n is missing, the number of vertices is computed from the number of x and y arguments. |
x-values | list of numeric constants, variables, or OF arguments that describe the x coordinates for the vertices in units based on the current window system. |
y-values | list of numeric constants, variables, or OF arguments that describe the y coordinates for the vertices in units based on the current window system. |
BAR on page 1448
FILCOLOR on page 1469
FILINDEX on page 1470
FILREP on page 1470
FILTYPE on page 1473
FILSTYLE on page 1471
HTML on page 1475
Displays an image
Operating State: SGOP
Return Codes: 0, 150
return-code-variable =GDRAW( IMAGE , external-file , x1 , y1 , x2 , y2 , style );
The GDRAW( IMAGE , ) function displays the specified image within opposing pairs of coordinates. The format of the external image file varies between operating environments. The (x1, y1) coordinate pair specifies one corner of the image, and the (x2, y2) coordinate pair specifies the opposite corner of the image. The style parameter must be either TILE to copy the image as many times as necessary to fill the area, or FIT to stretch one instance of the image to fill the area.
Draws a polyline
Operating States: SGOP
Return Codes: 0, 4, 61, 86, 100, 301
return-code-variable =GDRAW( LINE , n, x-values, y-values );
The GDRAW( LINE ) function draws one line, a series of connected lines, or a dot. The line attributes and bundles affect the appearance of this primitive. See Table 49.2 on page 1364 for a list of these attributes.
Note: All of the x coordinates are listed in the function first, followed by the y coordinates. This primitive takes the first n values and stores them as x coordinates and the next n values and stores them as y coordinates.
n | numeric constant or numeric variable name; the number of vertices ( x and y pairs) in the polygon. You can specify a missing value (.) for n . If n is missing, the number of vertices is computed from the number of x and y pairs. |
x-values | list of numeric constants, variables, or OF arguments that describe the x coordinates for the vertices in units based on the current window system. |
y-values | list of numeric constants, variables, or OF argument lists that describe the y coordinates for the vertices in units based on the current window system. |
FILCOLOR on page 1469
LININDEX on page 1477
LINREP on page 1478
LINTYPE on page 1479
LINWIDTH on page 1479
Draws a polymarker
Operating States: SGOP
Return Codes: 0, 4, 65, 86, 100, 301
return-code-variable =GDRAW ( MARK , n, x-values, y-values );
The GDRAW( MARK , ) function draws a series of symbols. The marker attributes and bundles affect the appearance of this primitive. See Table 49.2 on page 1364 for a list of these attributes. Refer to the MARTYPE on page 1483 for a list of symbols that you can draw with GDRAW( MARK , ).
Note: All of the x coordinates are listed in the function first, followed by the y coordinates. This primitive takes the first n values and stores them as x coordinates and the next n values and stores them as y coordinates.
n | numeric constant or numeric variable name; the number of times the symbol is drawn. You can specify a missing value (.) for n . If n is missing, the number of vertices is calculated from the number of x and y pairs. |
x-values | list of numeric constants, variables, or OF arguments that describe the x coordinates of the symbols in units based on the current window system. |
y-values | list of numeric constants, variables, or OF arguments that describe the y coordinates of the symbols in units based on the current window system. |
TEXT on page 1456
HTML on page 1475
MARCOLOR on page 1480
MARINDEX on page 1481
MARREP on page 1482
MARTYPE on page 1483
Prints a message in the SAS log
Operating States: All
Return Codes:
return-code-variable =GDRAW( MESSAGE , message );
The GDRAW( MESSAGE , ) function prints a message in the SAS log. This function may be used for debugging applications or for printing custom messages for your application.
message | character string enclosed in quotes or character variable name; the text to be printed in the log. |
MESSAGE on page 1485
GPRINT on page 1402
Draws a filled circle or section of a filled circle
Operating States: SGOP
Return Codes: 0, 4, 76, 79, 80, 86
return-code-variable =GDRAW( PIE , x, y, radius, start, end );
The GDRAW( PIE , ) function draws a filled section of a circular arc. The fill attributes and bundles affect the appearance of this primitive. See Table 49.2 on page 1364 for a list of these attributes.
x | numeric constant or numeric variable name; x coordinates are in units based on the current window system. |
y | numeric constant or numeric variable name; y coordinates are in units based on the current window system. |
radius | numeric constant or numeric variable name; the pie radius size in units based on the current window system. |
start | numeric constant or numeric variable name; the starting angle of the pie, with 0 degrees at 3 o clock on the unit circle. |
end | numeric constant or numeric variable name; the ending angle of the pie, with 0 degrees at 3 o clock on the unit circle. |
ARC on page 1446
FILCOLOR on page 1469
FILINDEX on page 1470
FILREP on page 1470
FILTYPE on page 1473
FILSTYLE on page 1471
HTML on page 1475
Draws a text string
Operating States: SGOP
Return Codes: 0, 4, 69, 86
return-code-variable =GDRAW( TEXT , x, y, string );
The GDRAW( TEXT , ) function draws a text string. The text attributes and bundles affect the appearance of this primitive. See Table 49.2 on page 1364 for a list of these attributes.
x | numeric constant or numeric variable name; x coordinates are in units based on the current window system. |
y | numeric constant or numeric variable name; y coordinates are in units based on the current window system. |
string | character string enclosed in quotes or character variable name; a set of characters to be drawn on the output beginning at position ( x , y ). |
MARK on page 1453
HTML on page 1475
TEXCOLOR on page 1488
TEXINDEX on page 1490
TEXREP on page 1492
TEXHEIGHT on page 1490