The GAREABAR Procedure |
Requirements: | One category variable, one width variable, and the SUMVAR= option variable. |
Global statements: | FOOTNOTE, GOPTIONS, LEGEND, PATTERN, TITLE |
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;
calculate the chart statistic for each bar (the default is SUM)
scale the response axes and the bars according to the statistic value
calculate the width of each bar, based on the value of the width variable
draw a frame around the axis area using a color determined by the current style
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:
use the LEGEND statement to modify the legend
use the TITLE and FOOTNOTE statements to add titles and footnotes to the chart
use the PATTERN statement to create PATTERN definitions that define the color and type of area fill for patterns used in graphs.
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:
appearance options:
CFRAME=background-color | |
CTEXT=text-color | |
FRAME | NOFRAME | |
LEGEND=LEGEND<1...99> | |
NOLEGEND |
statistic options:
RESPONSESTAT=statistic | |
WIDTHSTAT=statistic |
midpoint options:
CONTINUOUS | |
DISCRETE | |
SUBGROUP=subgroup-variable |
description options
DESCRIPTION="description" | |
NAME="name" |
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.
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.
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.
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.
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. |
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. |
specifies a color for all text on the chart. The GAREABAR procedure looks for the text color in the following order:
colors specified for labels and values on assigned LEGEND statements, which override the CTEXT= option specified on the GAREABAR statement
the color specified by the CTEXT= option in the GAREABAR statement
the color specified by the CTEXT= option in a GOPTIONS statement
the color specified in the current style
Alias: | CT= |
Style reference: | Color attributes of the GraphLabelText and GraphValueText elements |
Restriction: | Not supported by Java. |
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. |
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. |
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. |
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. |
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 |
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. |
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. |
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. |
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. |
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. |
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.