BAR Function

Draws a rectangle whose lower left corner is defined by the internal variables (XLAST, YLAST) and whose upper right corner is defined by the specified X, Y variable pair. You can define the color of the fill, the fill pattern, and the edge lines to be drawn.

Alias:BOX
Updates:XLAST, YLAST

Table of Contents

Syntax

FUNCTION='BAR';

Associated Variables

COLOR='color'

specifies the color of either the interior of the bar or the outline of the bar. Color can be any SAS/GRAPH color name. See COLOR Variable. The part of the bar affected depends on the value of the STYLE variable. If STYLE specifies a pattern or fill, the COLOR variable determines the color of the interior. If STYLE specifies an empty pattern, the COLOR variable determines the color of the outline of the bar.

GROUP=group-value

MIDPOINT=midpoint-value

SUBGROUP=subgroup-value

specify coordinates for HBAR and VBAR charts from the GCHART procedure. Use these variables only with the data coordinate systems 1, 2, 7, and 8.

SeeGROUP Variable
MIDPOINT Variable
SUBGROUP Variable

HTML='link-string'

specifies the text that defines the drill-down link.

SeeHTML Variable

LINE=0–3

specifies the direction in which to adjust the outline of the bar. Use LINE values 1 and 2 to a particular bar from an axis or adjoining area.

Default1
SeeLINE Variable

SIZE=line-thickness

specifies a line thickness for the rectangle

Sample Line Thicknesses Used with the SIZE Variable
Sample Line Thicknesses Used with the SIZE Variable
SeeSIZE Variable

STYLE='SOLID' | 'EMPTY' | style<density>

specifies the pattern that fills the bar.

SOLID

specifies a solid color fill.

EMPTY

specifies no fill.

style<density>

specifies a fill style and density.

DefaultEMPTY
RestrictionThe JAVAIMG device supports only SOLID and EMPTY.
SeeSTYLE Variable: Patterns

WHEN='B' | 'A'

specifies when to draw the bar in relation to other procedure output.

B

specifies that the bar is drawn before the other procedure output is drawn.

A

specifies that the bar is drawn after the other procedure output is drawn.

SeeWHEN Variable

X=horizontal-coordinate

Y=vertical-coordinate

Z=depth-coordinate

XC='character-type-horizontal-coordinate'

YC='character-type-vertical-coordinate'

define the upper right corner of a bar (rectangle) whose lower left corner is (XLAST,YLAST). Points Used to Construct a Bar illustrates the use of these coordinates.

RestrictionThe Z= variable is used with the G3D procedure only.
SeeX Variable
Y Variable
Z Variable
XC Variable
YC Variable

XSYS='coordinate-system'

specifies the coordinate system for the X or XC variable. The XC variable can be used only with XSYS='2'.

SeeXSYS Variable

YSYS='coordinate-system'

specifies the coordinate system for Y or YC variable. The YC variable can be used with YSYS='2' only.

SeeYSYS Variable

ZSYS='coordinate-system'

specifies the coordinate system for the Z variable.

RestrictionThe ZSYS= variable is used with the G3D procedure only.
SeeZSYS Variable

Details

Points Used to Construct a Bar shows how the XLAST, YLAST, and X, Y variables define the diagonal corners of the bar. With character data, the XC and YC variables are used in place of the X and Y variables. The values of the XLAST and YLAST variables are usually initialized with a MOVE function or another function that updates the XLAST and YLAST pair. When the XC variable is used, set XSYS='2'. When the YC variable is used, set YSYS='2'.

Points Used to Construct a Bar
Points Used to Construct a Bar
Last updated: June 23, 2026