%SLICE Annotate Macro

Draws a arc, pie slice, or circle, with available line types, colors, and fill types.

Updates:XLAST, YLAST
Variables written out:ANGLE, COLOR, FUNCTION, LINE, ROTATE, SIZE, STYLE, X, Y
Requirement:You must run the %ANNOMAC macro before using this or any of the other SAS/GRAPH annotate macros. See Making the Macros Available.

Table of Contents

Syntax

%SLICE (x, y, angle, rotate, size, color, style, WHOLE | NONE | LEAD | TRAIL | BOTH);

Parameters

x, y

specify the center point of the arc. Values can be numbers, numeric constants, or numeric variables.

SeeX Variable and Y Variable

angle

specifies the starting point of the arc. The value can be a number, a numeric constant, or a numeric variable.

SeeANGLE Variable for the PIE function for valid angle values.

rotate

specifies the sweep of the arc. The value can be a number, a numeric constant, or a numeric variable.

InteractionWhen LINE=WHOLE is specified, the %SLICE macro always specifies ROTATE=360 for the PIE function in the Annotate data set.
SeeROTATE Variable for the PIE function for valid rotate values.

size

specifies the radius of the arc. The value can be a number, a numeric constant, or a numeric variable.

SeeSIZE Variable

color

specifies the color of the arc outline and optional fill using a character string without quotation marks. Use an asterisk (*) to specify the previous value of the color parameter.

SeeCOLOR Variable

style

specifies the fill pattern for the slice or circle, using a character string without quotation marks.

SeeSTYLE Variable: Patterns for the PIE function for valid style values.

WHOLE | NONE | LEAD | TRAIL | BOTH

specifies which lines of a pie slice are to be drawn. The value can be one of the following, which are shown in LINE Values Used with the %SLICE Macro:

WHOLE

draws the entire 360 degree outside arc, starting at the specified angle, with no radius lines.

NONE

draws the outside arc from the specified starting angle through the specified rotation with no radius lines.

LEAD

draws the outside arc from the specified starting angle through the specified rotation and a radius line from the lead point to the center.

TRAIL

draws the outside arc from the specified starting angle through the specified rotation and a radius line from the trail point to the center.

BOTH

draws the outside arc from the starting angle through the specified rotation, a lead radius line, and a trail radius line.

The following figure illustrates each of the line values.

LINE Values Used with the %SLICE Macro
Line Values WHOLE or NONE, LEAD, TRAIL, and BOTH

In the Annotate data set, these values are converted to the PIE function LINE values shown in the following table.

Macro %SLICE LINE Value

PIE Function LINE Value

WHOLE

0 1

NONE

0

LEAD

1

TRAIL

2

BOTH

3

1 When LINE=WHOLE is specified, LINE=0 and ROTATE=360 are specified for the PIE function in the Annotate data set.

See LINE Variable for the PIE function.

Last updated: January 17, 2025