Previous Page | Next Page

The GBARLINE Procedure

PLOT Statement


Creates one or more plot overlays on top of the bar-line chart.
Requirements: If specified, PLOT statements must be specified after the BAR statement.
Global statements: AXIS, FOOTNOTE, PATTERN, SYMBOL, TITLE
Supports: Data tips and drill-down functionality
Restriction: Not supported by Java


Description

The PLOT statement specifies one plot request. You can use multiple PLOT statements to generate multiple plots. The PLOT 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, suppress the joining of data points, or specify other types of interpolations. For more information on the SYMBOL statement, see SYMBOL Statement.

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


Syntax

PLOT </options(s)>;

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

To specify a variable to plot, use the SUMVAR= option. If you do not specify a plot variable, GBARLINE uses the chart variable as the plot variable. For more information, see About Response Variables and the description of the SUMVAR= option.

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


Options

You can specify as many options as you want and list them in any order.

ASCENDING

joins the plot points in ascending order of the value of the plot statistic. By default, plot points are connected from left to right.

AUTOREF

draws a reference line at each major tick mark on the plot (right) response axis. To draw reference lines at specific points on the response axis, use the REF= option. By default, reference lines are drawn in front of the bars. To draw reference lines behind the bars, use the CLIPREF option.

AXIS=AXIS<1...99>

See RAXIS=.

CAUTOREF=reference-line-color

specifies the color of reference lines drawn at major tick marks, as determined by the AUTOREF option. If you do not specify the CAUTOREF option, the default color is the value of the CAXIS= option. If neither option is specified, the default color is retrieved from the current style or from the device's color list if the NOGSTYLE system option is specified. To specify a line type for these reference lines, use the LAUTOREF= option.

Style reference: Color attribute of the GraphGridLines element.
CAXIS=axis-color

specifies a color for the tick marks and for the axis area frame on the plot (right) response axis.

If you omit the CAXIS option, the default color is the color defined by the default style or is the first color in the color list.

CLIPREF

clips the reference lines at the bars. Using this option makes the reference lines appear to be behind the bars.

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

specifies colors for reference lines. Specifying a single color without parentheses applies that color to all reference lines, including lines drawn with the AUTOREF and REF= options. The CAUTOREF= option overrides the CREF= reference line color for reference lines drawn with the AUTOREF option. Specifying a single color in parentheses applies that color only to the first reference line drawn with the REF= option. Specifying a reference color list applies colors in sequence to successive lines drawn with the REF= option. The syntax of the color list is of the form (color1 color2 ...colorN) or (color1, color2 ..., colorN). If you do not specify the CREF= option, the GBARLINE procedure uses the color specified by the CAXIS= option. If neither option is specified, then the default color is retrieved from the current style or from the first color in the color list if the NOGSTYLE option is specified. To specify line types for these reference lines, use the LREF= option.

Alias: CRF=
Style reference: LineStyle attribute of the GraphGridLines element.
CTEXT=text-color

specifies a color for all text on the plot response axis and legend, including axis labels, tick mark values, legend labels, and legend value descriptions. The GBARLINE procedure looks for the text color in the following order:

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

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

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

  4. the color specified in the current style or, if the NOGSTYLE system option is specified, then the default color is black for the ActiveX device and the first color in the color list for all other devices.

The LEGEND statement's VALUE= color is used for legend values, and its LABEL= color is used for legend labels.

The AXIS statement's VALUE= color is used for axis values, and its LABEL= color is used for axis labels. However, if the AXIS statement specifies only general axis colors with its COLOR= option, then the CTEXT= color overrides the AXIS statement's COLOR= specification, and the CTEXT= color is used for axis labels and values. The COLOR= color is still used for all other axis elements, such as tick marks.

Note:   If you use a BY statement in the procedure, the color of the BY variable labels is controlled by the CBY= option in the GOPTIONS statement.  [cautionend]

Style reference: GraphLabelText, GraphValueText
DESCENDING

joins the plot points in descending order of the value of the plot statistic. By default, plot points are connected from left to right.

FREQ=numeric-variable

specifies a variable whose values weight the contribution of each observation in the computation of the plot statistic. Each observation is counted the number of times that is specified by the value of numeric-variable for that observation. If the value of numeric-variable is missing, zero, or negative, then the observation is not used in the statistic calculation. Non-integer values of numeric-variable are truncated to integers. The FREQ= option is valid with all plot statistics.

Because you cannot use TYPE=PERCENT, TYPE=CPERCENT, TYPE=FREQ, or TYPE=CFREQ with the SUMVAR= option, you must use the FREQ= option to calculate percentages, cumulative percentages, frequencies, or cumulative frequencies based on a sum.

The statistics are not affected by applying a format to numeric-variable.

Restriction: Not supported by ActiveX
HTML=variable

identifies the variable in the input data set whose values create links in the HTML file created by the ODS statement. These links are associated with the plot points and bars. The links point to the data or graph that you want to display when the user drills down on the plot point or bar area. This option is featured in Specifying Subgroups, Multiple Plots, Data Tips, and Drill-Down URLs.

See also: Data Tips for Web Presentations and Adding Links with the HTML= and HTML_LEGEND= Options.
HTML_LEGEND=variable

identifies the variable in the input data set whose values create links in the HTML file that is created by the ODS statement. These links are associated with a legend value and point to the data or graph that you want to display when the user drills down on the value. The values of variable can be up to 1024 characters long. Characters after the 1024-character limit (including any closing quotes) are truncated.

Restriction: Not supported by Java and ActiveX
See also: Data Tips for Web Presentations and Adding Links with the HTML= and HTML_LEGEND= Options.
LAUTOREF=reference-line-type

specifies the line type for reference lines at major tick marks, as determined by the AUTOREF option. Line types are specified as whole numbers from 1 to 46, with 1 representing a solid line and the other values representing dashed lines. The default line type is retrieved from the current style, or if the NOGSTYLE option is specified, the default value is 1, which draws a solid line. To specify a color for these reference lines, use the CAUTOREF= option.

LEGEND=LEGEND<1...99>

Generates a legend and assigns the specified LEGEND definition to the legend. LEGEND= is ignored if the specified LEGEND definition is not in effect. When you specify the LEGEND option, the BAR statement generates a legend even if the SUBGROUP= option is not specified. This output differs from the output generated by the GCHART procedure where the SUBGROUP option automatically creates a legend by default. In this case, only one bar is represented in the legend.

Only one PLOT statement can contain a LEGEND= reference. If you request a PLOT legend, then all of the PLOT lines are displayed in the legend.

You can specify both a BAR and PLOT legend on the same graph. If LEGEND= is specified for both the BAR and the POSITION= options on the LEGEND statements are the same location, a single combined legend will be drawn. However, ActiveX output will display separate but adjacent legends.

The ActiveX device does not support all LEGEND statement options. See LEGEND Statement for more information.

Featured in: Specifying Subgroups, Multiple Plots, Data Tips, and Drill-Down URLs
Restriction: Not supported by Java. Partially supported by ActiveX.
See also: LEGEND Statement
LREF=reference-line-type|( reference-line-type|reference-line-type-list)

specifies line types for reference lines. Line types are specified as whole numbers from 1 to 46, with 1 representing a solid line and the other values representing dashed lines. Specifying a line type without parentheses applies that type to all reference lines drawn with the AUTOREF and REF= options. Note that the LAUTOREF= option overrides LREF=reference-line-type for reference lines drawn with the AUTOREF option. Specifying a single line type in parentheses applies that line type to the first reference line drawn with the REF= option. Specifying a line type list applies line types in sequence to successive reference lines drawn with the REF= option. The syntax of the line-type list is of the form (type1 type2 ...typeN). If you do not specify the LREF= option, the GBARLINE procedure uses the type specified by the AXIS statement's STYLE= option. If neither option is specified, the default line type is retrieved from the current style. If the NOGSTYLE option is specified, the default value is 1, which draws a solid line. To specify colors for these reference lines, use the CREF= option.

Alias: LR=
Style reference: GraphReference
Restriction: Not supported by Java
MINOR=number-of-minor-ticks

specifies the number of minor tick marks that are drawn between each major tick mark on the PLOT response axis. Minor tick marks are not labeled. The MINOR= option overrides the NUMBER= suboption of the MINOR= option in an AXIS definition. You must specify a positive number.

NOAXIS

suppresses the right PLOT response axis and displays the midpoint and left BAR axes. The axis lines, axis labels, axis values, and all major and minor tick marks are suppressed on the right axis. If you specify an axis definition with the MAXIS= or RAXIS= options, then the axes are generated as defined in the AXIS statement, but all lines, labels, values, and tick marks are suppressed. Therefore, AXIS statement options such as ORDER=, LENGTH=, and OFFSET= are still used.

To remove only selected axis elements such as lines, values, or labels, use specific AXIS statement options.

NOAXIS does not suppress either the default frame or an axis area fill requested by the CFRAME= option. To remove the axis frame, use the NOFRAME option in the procedure.

NOLINE

suppresses the line connecting the PLOT symbols, regardless of what is specified in the SYMBOL statement.

NOMARKER

suppresses drawing the marker symbol, regardless of what is specified in the SYMBOL statement.

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

specifies the major tick mark values for the PLOT (right) response axis or assigns an AXIS definition.

The way you specify value-list depends on the type of variable:

  • For numeric variables, value-list is either an explicit list of values, or a starting and an ending value with an interval increment, or a combination of both forms:

    n <...n>

    n TO n <BY increment>

    n <...n> TO n <BY increment > <n <...n> >

    If a numeric variable has an associated format, the specified values must be the unformatted values.

  • For date-time values, value-list includes any SAS date, time, or datetime value described for the SAS functions INTCK and INTNX, shown here as SAS-value:

    'SAS-value'i < ...'SAS-value'i>

    'SAS-value'i TO 'SAS-value'i<BY interval>

Any response values that exceed the highest tick mark value are not plotted. The overlay plot line connects only the visible plot response values.
REF=value-list

draws reference lines at the specified points using the chart response axis. See the MIDPOINTS= option for a description of value-list.

Values can be listed in any order, but should be within the range of values represented by the PLOT response axis. A warning is written to the SAS log if any of the points are off of the axis, and no reference line is drawn for such points. You can use the AUTOREF option to draw reference lines automatically at all of the major tick marks.

SUMVAR=plot-variable

specifies the variable to plot. Plot-variable, if specified, must be numeric. The GBARLINE procedure calculates the sum or, if requested, the mean of plot-variable for each midpoint.

When you use the SUMVAR= option, the TYPE= option must be either SUM or MEAN. With the SUMVAR= option, the default is TYPE=SUM.

Featured in: Producing a Basic Bar-Line Chart
See also: About Response Variables
TYPE=statistic

specifies the plot statistic.

  • If the SUMVAR= option is not used, statistic can be one of the following:

    FREQ

    frequency ( default)

    CFREQ

    cumulative frequency

    PERCENT

    percentage

    CPERCENT

    cumulative percentage

  • If SUMVAR= is used, statistic can be one of the following:

    SUM

    sum ( default)

    MEAN

    mean

Because you cannot use TYPE=FREQ, TYPE=CFREQ, TYPE=PERCENT, or TYPE=CPERCENT with SUMVAR=, you must use FREQ= to calculate percentages or frequencies based on a sum.

See also: About Chart Statistics and Calculating Weighted Statistics
WAUTOREF=reference-line-width

specifies the line width for reference lines at major tick marks, as determined by the AUTOREF option. Line widths are specified as whole numbers. The default line width is specified by the current style or by the AXIS statement's WIDTH= option. (By default, WIDTH=1.) To specify a color for these reference lines, use the CAUTOREF= option.

Style reference: LineThickness attribute of the GraphGridLines element.
WREF=reference-line-width|( reference-line-width|reference-line-width-list)

specifies line widths for reference lines. Line widths are specified as whole numbers. Specifying a line width without parentheses applies that type to all reference lines drawn with the AUTOREF and REF= options. Note that the WAUTOREF= option overrides WREF=reference-line-width for reference lines drawn with the AUTOREF option. Specifying a single line width in parentheses applies that line width to the first reference line drawn with the REF= option. Specifying a line width list applies line widths in sequence to successive reference lines drawn with the REF= option. The syntax of the line-width list is of the form (width1 width2 ...widthN). The default line width is specified by the current style or by the AXIS statement's WIDTH= option. (By default, WIDTH=1.) To specify colors for these reference lines, use the CREF= option.

Style reference: LineThickness attribute of the GraphReference element.

About SYMBOL Definitions

SYMBOL statements control the appearance of plot symbols and lines. They can specify the following attributes:

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. For multiple PLOT statements where no SYMBOL statements were specified, the procedure rotates through the default symbols for the current device.

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


About Interpolation Methods

You can produce plot overlays such as step plot overlays by specifying interpolation methods with the SYMBOL statement. For PROC GBARLINE, you can use the SYMBOL statement to do the following tasks:

For bar-line charts, points on the plot overlays are automatically connected by default, which is equivalent to specifying the JOIN interpolation method.

SYMBOL Statement describes the JOIN, STEP, and NONE interpolation methods.

Previous Page | Next Page | Top of Page