Previous Page | Next Page

The GAREABAR Procedure

HBAR, HBAR3D, VBAR, and VBAR3D Statements


Create horizontal or vertical bar charts in which the length or height of the bar represents the value of a chart statistic for each category of data. A second statistic is represented by the width of each bar.
Requirements: One category variable, one width variable, and the SUMVAR= option variable.
Global statements: FOOTNOTE, GOPTIONS, LEGEND, PATTERN, TITLE


Description

The HBAR, HBAR3D, VBAR, and VBAR3D statements specify the variables that define the categories, and width of each bar. The SUMVAR= option variable calculates the length or height of each bar. These statements do the following;

You can use statement options to change the type of chart, to display specific statistics, and to modify the appearance of the chart. You can also specify an additional variable to subgroup your data, which divides the bars into segments and displays a legend to identify the segments.

In addition, you can make the following changes with global statements:


Syntax

HBAR | HBAR3D | VBAR | VBAR3D chart-variable*width-variable SUMVAR=numeric-variable</ option(s)>;

option(s)can be one or more options from any or all of the following categories:


Required Arguments

The options in an HBAR, HBAR3D, VBAR, and VBAR3D statement affect all graphs that are produced by that statement. You can specify as many options as you want, and list them in any order.

category-variable

specifies the variable that defines the categories of data to chart. The CATEGORY variable can be either character or numeric. Each unique value of the category variable results in a separate bar.

sumvar=variable

specifies the variable that defines the height of each vertical bar or length of each horizontal bar. The SUMVAR= option variable is always numeric. The default statistic is sum.

width-variable

specifies the variable that defines the width of each bar. The WIDTH variable is always numeric. The width of each bar represents the sum of the width variable values for that category. The default statistic is sum.


Options

The options in an HBAR, HBAR3D, VBAR, and VBAR3D statement affect all graphs that are produced by the statement. You can specify as many options as you want and list them in any order.


CFRAME=background-color

specifies a background color for the graph. The specified color must be a valid SAS/GRAPH color name.

Alias: CFR=
Style reference: Color attribute of GraphBackground element
Restriction: Not supported by Java.
CONTINUOUS

specifies that the graph data be treated as continuous. Continuous data can take any of an infinite number of values between whole numbers, and so might not be measured accurately. The default is discrete.

Restriction: Not supported by Java.
CTEXT=text-color

specifies a color for all text on the chart. The GAREABAR procedure looks for the text color in the following order:

  1. colors specified for labels and values on assigned LEGEND statements, which override the CTEXT= option specified on the GAREABAR statement

  2. the color specified by the CTEXT= option in the GAREABAR statement

  3. the color specified by the CTEXT= option in a GOPTIONS statement

  4. the color specified in the current style

Alias: CT=
Style reference: Color attributes of the GraphLabelText and GraphValueText elements
Restriction: Not supported by Java.
DESCRIPTION="description"

specifies the description of the plot. The maximum length for description is 256 characters.

The descriptive text is displayed as follows:

  • the description in the Results window

  • the properties that you view from the Explorer window

  • the Table of Contents that is generated when you use CONTENTS= on an ODS HTML statement, assuming the output is generated while the contents page is open

  • the ALT= text in the HTML file when the output destination is ODS HTML

  • customized by inserting BY variable values with #BYLINE, #BYVAL(n), and #BYVAR(n)

Alias: DES=
Default: GAREABAR ofcategory variable
Restriction: Not supported by Java.
DISCRETE

treats the chart variable axis data as discrete data. Discrete data is characterized as data in which the variable can take only one of a finite set of values. The GAREABAR procedure creates a separate bar for each unique value of the chart variable. If the chart variable has a format associated with it, each formatted value is treated as a unique value. The default is discrete.

Restriction: Not supported by Java.
FRAME | NOFRAME

specifies whether the two-dimensional axis area frame or the three-dimensional backplane is drawn. The default is FRAME, which draws a frame around the axis areas (in two-dimensional bar charts) or generates a colored three-dimensional backplane (in three-dimensional bar charts). For three-dimensional charts, NOFRAME removes the backplane color, and leaves the backplane grid, the vertical axis and plane, and the horizontal axis and plane.

The NOFRAME option overrides the CFRAME= option.

Alias: FR | NOFR
Restriction: Not supported by Java.
LEGEND=LEGEND<1...99>

assigns the specified LEGEND definition to the legend generated by the SUBGROUP= option. The LEGEND= option itself does not generate a legend.

LEGEND= is ignored if any of the following are true:

  • The SUBGROUP= option is not used.

  • The specified LEGEND definition is not in effect.

  • The NOLEGEND option is used.

Restriction: The LEGEND statement options are partially supported by ActiveX.
See also: LEGEND Statement
Restriction: Not supported by Java.
NAME="name"

specifies the name of the graphics output file. The name can be up to 256 characters long. Uppercase characters are converted to lowercase. The default name is graph.png . If the name duplicates and existing name, then SAS/GRAPH adds a number to the name to create a unique name, for example, graph1.png .

Restriction: Not supported by Java.
See also: About Filename Indexing
NOLEGEND

suppresses the legend that is automatically generated by the SUBGROUP= option. The NOLEGEND option is ignored if the SUBGROUP= option is not used.

Restriction: Not supported by Java.
RESPONSESTAT= SUM |PCT| PERCENT

specifies the statistic for subgroups. The default is sum.

If the SUBGROUP= option is not specified, then the RESPONSESTAT= option is ignored.

Alias: RESPSTAT= or RSTAT=
Restriction: Not supported by Java.
SUBGROUP=subgroup-variable

divides the bars into segments according to the values of the subgroup-variable. The subgroup-variable can be either character or numeric, and is always treated as a discrete variable. The SUBGROUP= option creates a separate segment within each bar for each unique value of the subgroup variable.

Restriction: Not supported by Java.
SUMVAR=summary-variable

specifies the numeric variable for the sum calculation. The GAREABAR procedure calculates the sum of for each category to determine the length or height of each bar.

Restriction: Not supported by Java.
WIDTHSTAT= SUM | PCT | PERCENT

specifies whether the WIDTH= option statistic is a percent or a sum. The default statistic is sum.

Alias: WSTAT=SUM | PCT | PERCENT
Restriction: Not supported by Java.

Previous Page | Next Page | Top of Page