SAS.GRAPH 9.1 Reference, Volumes I and II

Requirements:

Global statements: AXIS, FOOTNOTE, GOPTIONS, PATTERN, TITLE

Reminder: The procedure can include the BY, FORMAT, LABEL, and WHERE statements also.

Supports:

Not supported by: Java

PROC GBARLINE <DATA= input-data-set >

BAR bar-variable </ option(s) >;

< PLOT </ option(s) >;>

PROC GBARLINE Statement

Identifies the data set containing the chart variables . Optionally specifies annotation.

Requirements: An input data set is required.

Not supported by: Java

Syntax

Options

PROC GBARLINE statement options affect all graphs produced by the procedure.

ANNOTATE= Annotate-data-set

ANNO= Annotate-data-set

DATA= input-data-set

IMAGEMAP= output-data-set

BAR Statement

Creates vertical bar charts in which the height of the bars represents the value of the bar statistic for each category of data.

Requirements: One bar variable is required.

Global statements: AXIS, FOOTNOTE, PATTERN, TITLE

Supports: Drill-down functionality

Not supported by: Java

Description

The BAR statement specifies the variable that defines the categories of data to chart. These statements automatically

You can use statement options to select or order the midpoints (bars), to control the tick marks on the response axis, to change the type of bar statistic, to display specific statistics, and to modify the appearance of the chart. You can also specify additional variables by which to sum the data.

In addition, you can

Syntax

Required Arguments

bar-variable

Options

Options in the BAR 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. For details on specifying colors, see Chapter 6, SAS/GRAPH Colors and Images, on page 91. For details on specifying images, see Specifying Images in SAS/GRAPH Programs on page 106. For a complete description of the graphics options, see Chapter 8, Graphics Options and Device Parameters Dictionary, on page 261.

ANNOTATE= Annotate-data-set

ANNO= Annotate-data-set

ASCENDING

AUTOREF

AXIS=AXIS<1...99>

CAUTOREF= reference-line-color

CAXIS= axis-color

CERROR= error-bar-color

CFRAME= background-color

CFR= background-color

CFREQ

CLIPREF

CLM= confidence-level

COUTLINE= bar-outline-color SAME

CPERCENT

CPCT

CREF= reference-line-color ( reference-line-color ) reference-line-color-list

CR= reference-line-color ( reference-line-color ) reference-line-color-list

CTEXT= text-color

DESCENDING

DESCRIPTION= entry-description

DES= entry-description

DISCRETE

ERRORBAR=BARS BOTH TOP

FRAME NOFRAME

FR NOFR

FREQ

FREQ= numeric-variable

FRONTREF

HTML= variable

INSIDE= statistic

LAUTOREF= reference-line-type

LEVELS= number-of-midpoints

LREF= reference-line-type ( reference-line-type reference-line-type-list )

LR= reference-line-type ( reference-line-type reference-line-type-list )

MAXIS=AXIS<1...99>

MEAN

MIDPOINTS= value-list

MIDPOINTS=OLD

MINOR= number-of-minor-ticks

MISSING

NAME= string

NOAXIS

NOBASEREF

NOZERO

OUTSIDE= statistic

PATTERNID=BY MIDPOINT

PERCENT

PCT

RANGE

RAXIS= value-list AXIS<1...99>

AXIS= value-list AXIS<1...99>

REF= value-list

SPACE= bar-spacing

SUM

SUMVAR= summary-variable

TYPE= statistic

WIDTH= bar-width

WOUTLINE= bar-outline-width

The Bar Statistic and the Response Axis

In bar line charts, the scale of values of the bar statistic is displayed on the left response axis. By default, the response axis is divided into evenly spaced intervals identified with major tick marks that are labeled with the corresponding statistic value. Minor tick marks are evenly distributed between the major tick marks unless a log axis has been requested. For sum and mean statistics, the major tick marks are labeled with values of the SUMVAR= variable (formatted if the variable has an associated format). The response axis is also labeled with the statistic type.

Displaying Statistics In Bar Line Charts

Statistic values on bar line charts are not printed by default, so you must explicitly request a statistic with the FREQ, CFREQ, PERCENT, CPERCENT, SUM, MEAN, INSIDE=, or OUTSIDE= option.

For graphs generated with the ActiveX device, you can display one statistic for each bar. For graphs generated with other devices, you can display up to two statistics for each bar. Statistics can be displayed either above the bars or inside the bars.

To specify a statistic that you want to display above the bars, specify the statistic option (FREQ, CFREQ, PERCENT, CPERCENT, SUM, or MEAN) or specify OUTSIDE= statistic . To specify a statistic that you want to display inside the bars, specify INSIDE= statistic .

For graphs generated with the ActiveX device, the OUTSIDE= option overrides INSIDE=, and INSIDE= overrides the FREQ, CFREQ, PERCENT, CPERCENT, SUM, and MEAN options. For graphs generated with other devices, the individual statistic options override the OUTSIDE= option.

If more than one statistic option is specified, only the highest priority statistic is displayed. The priority order, from highest to lowest, is as follows:

  1. FREQ

  2. CFREQ

  3. PERCENT

  4. CPERCENT

  5. SUM

  6. MEAN

The bars must be wide enough to accommodate the text. You can adjust the width of the bars with the WIDTH= option. To control the font and size of the text, use the HTEXT= and FTEXT= graphics options.

Ordering and Selecting Midpoints

To rearrange character or discrete numeric midpoint values or to select ranges for numeric values, use the MIDPOINTS= option. Remember that although changing the number of midpoints for numeric variables may change the range of values for individual midpoints, it does not change the range of values for the chart as a whole. For details, see About Midpoints on page 742.

Like the MIDPOINTS= option, the ORDER= option in the AXIS statement can rearrange the order of the midpoints or suppress the display of discrete numeric or character values. However, the ORDER= option cannot calculate the midpoints for a continuous numeric variable, or exclude values from the calculations. For details, see the description of the ORDER= option on page 130.

Controlling Bar Line Chart Patterns, Colors, and Images

Default Patterns and Outlines

Each bar in a bar line chart is filled with a pattern. By default, the procedure

See About Patterns on page 748 for more information on how the GBARLINE procedure assigns default patterns and outlines.

User-Defined Patterns

To override the default patterns and select fills and colors for the bars, use the PATTERN statement. Only solid and empty bar patterns are valid; all other pattern fills are ignored. For a complete description of all bar patterns, see the VALUE= option on page 171.

Whenever you use PATTERN statements, the default pattern outline color changes to SAME. That is, the outline color is the same as the fill color. To specify the outline color, use the COUTLINE= option (see COUTLINE= on page 754).

When Patterns Change

The PATTERNID= option controls when the pattern changes. By default, PATTERNID=MIDPOINT, which specifies that the pattern changes every time the midpoint value changes.

Instead of changing the pattern for each midpoint, you can change the pattern for each BY group by changing the value of the PATTERNID= option. See the PATTERNID= option on page 761 for details.

Axis Color

By default, axis elements use the first color in the colors list or the colors that are specified by AXIS statement color options. However, BAR statement options can also control the color of the axis lines, text, and frame.

To change the color of...

Use this option...

the axis text

CTEXT=

the axis lines

CAXIS=

the area within the frame

CFRAME=

Adding Images to Bar Line Charts

You can apply images to the bars and to the backplane frame of bar line charts developed with the BAR statement. For details, see Specifying Images in SAS/GRAPH Programs on page 106.

PLOT Statement

Creates a plot overlay on top of the bar line chart.

Requirements: If specified, the PLOT statement must be specified after the BAR statement.

Global statements: AXIS, FOOTNOTE, PATTERN, SYMBOL, TITLE

Supports: Drill-down functionality

Not supported by: Java

Description

The PLOT statement specifies one plot request. This statement automatically

You can use statement options to specify a plot variable, manipulate the plot response axis, modify the appearance of your graph, and describe catalog entries. You can use SYMBOL definitions to modify plot symbols for the data points, join data points, or specify other types of interpolations. For more information on the SYMBOL statement, see SYMBOL Statement on page 183.

In addition, you can use global statements to modify the axis, or add titles, footnotes, and notes to the plot.

Syntax

PLOT </ options(s) >;

The PLOT statement is optional, but if specified, it must follow the BAR statement. If you do not specify a PLOT statement, GBARLINE generates only a bar chart and duplicates the bar response axis (left axis) as the plot response axis (right axis).

To specify a variable to plot, use the SUMVAR= option. If you do not specify a plot variable, GBARLINE uses the bar variable as the plot variable. For more information, see About the Plot Variable on page 745 and the description of the SUMVAR= option.

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

Options

ASCENDING

AXIS=AXIS<1...99>

DESCENDING

FREQ= numeric-variable

HTML= variable

MINOR= number-of-minor-ticks

NOLINE

NOMARKER

RAXIS= value-list AXIS<1...99>

AXIS= value-list AXIS<1...99>

SUMVAR= plot-variable

TYPE= statistic

About SYMBOL Definitions

SYMBOL statements control the appearance of plot symbols and lines, and define interpolation methods . They can specify

SYMBOL definitions are assigned either by default by the GBARLINE procedure or explicitly with a plot request.

If no SYMBOL definition is currently in effect, the GBARLINE procedure produces a join interpolation using the default plot symbol. The default plot symbol for ActiveX device drivers is the square. For other devices, the default symbol is the plus sign (+).

See SYMBOL Statement on page 183 for a complete discussion of the features of the SYMBOL statement.

Категории