GBARLINE Procedure

PLOT Statement

Creates one or more plot overlays on top of the bar-line chart.
Restriction: Not supported by JAVA
Requirement: This option affects graphics output that is created through the ODS HTML destination only. If specified, PLOT statements must be specified after the BAR statement.
Global statements: AXIS, FOOTNOTE, LEGEND, PATTERN, SYMBOL, TITLE
Supports: Data tips and drill-down functionality

Syntax

PLOT </options(s)>;

Summary of Optional Arguments

Appearance options
specifies the color of reference lines drawn at major tick marks, as determined by the AUTOREF option.
specifies a color for the tick marks and for the axis area frame on the plot (right) response axis.
specifies colors for reference lines.
specifies a color for all text on the plot response axis and legend.
specifies the line type for reference lines at major tick marks, as determined by the AUTOREF option.
generates a legend and assigns the specified LEGEND definition to the legend.
specifies line types for reference lines.
suppresses the line connecting the PLOT symbols
suppresses drawing the marker symbol.
specifies the line width for reference lines at major tick marks, as determined by the AUTOREF option.
specifies line widths for reference lines.
Axes options
joins the plot points in ascending order of the value of the plot statistic.
draws a reference line at each major tick mark on the plot (right) response axis.
specifies values for the major tick marks or assigns specified AXIS definitions to the axis.
clips the reference lines at the bars.
joins the plot points in descending order of the value of the plot statistic.
specifies the number of minor tick marks that are drawn between each major tick mark on the PLOT response axis.
suppresses the right PLOT response axis and displays the midpoint and left BAR axes.
specifies the major tick mark values for the PLOT (right) response axis or assigns an AXIS definition.
draws reference lines at the specified points using the chart response axis.
ODS options
identifies the variable in the input data set whose values create links.
identifies the variable in the input data set whose values create links or data tips or both.
specifies a character variable whose values are URLs.
Statistic options
displays the cumulative frequency statistic above each plot data point.
displays the cumulative percentage statistic above each plot data point.
displays the frequency statistic above each plot data point.
specifies a variable whose values weight the contribution of each observation in the computation of the plot statistic.
displays the mean statistic above each plot data point.
displays the percentages of observations that have a given value for the plot variable above each plot data point.
displays the sum statistic above each plot data point.
specifies the variable to plot.
specifies the plot statistic.

Optional Arguments

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>
specifies values for the major tick marks or assigns specified AXIS definitions to the axis.
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.
CFREQ
displays the cumulative frequency statistic above each plot data point. If symbols are used, it appears above each symbol. CFREQ is ignored if the PERCENT or CPERCENT option is specified.
CLIPREF
clips the reference lines at the bars. Using this option makes the reference lines appear to be behind the bars.
CPERCENT
displays the cumulative percentage statistic above each plot data point. If symbols are used, it appears above each symbol. CPERCENT overrides the FREQ, CFREQ, and PERCENT options.
Alias:CPCT
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 requires parentheses and color names separated by spaces (color1 color2 ...colorN) or separated by commas (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. This includes 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. However, if the NOGSTYLE system option is specified, then 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. This means that 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.
Alias:CT=
Style reference:GraphLabelText, GraphValueText
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.
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
displays the frequency statistic above each plot data point. If symbols are used, it appears above each symbol. Non-integer values are rounded down to the nearest integer.
Restriction:FREQ is ignored if the CFREQ, PERCENT, or CPERCENT option is specified.
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.
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 or data tips or both. The variable values are either links or data tips or both that are created in the HTML file generated by the ODS statement. The links are URLs pointing to Web pages to display when the user clicks (drills down) on elements in the graph. Data tips are detailed information or data values that are displayed as pop-up text when a mouse pointer is positioned over elements in the graph.
HTML_LEGEND=variable
identifies the variable in the input data set whose values create links. Input data set variable values create links that are associated with a legend value and point to the URL to display when the user clicks (drills down) on the value.
Restriction:Not supported by Java and ActiveX
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. The LEGEND= option 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.
You can specify both a BAR and PLOT legend on the same graph. If you specify the same location with the LEGEND= option in the BAR statement and the POSITION= option in the LEGEND statement, a single combined legend is drawn. However, ActiveX output displays separate but adjacent legends.
The ActiveX device does not support all LEGEND statement options.
Restriction:Not supported by Java. Partially supported by ActiveX.
Note: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.
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 requires parentheses and types separated by spaces (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
MEAN
displays the mean statistic above each plot data point. If symbols are used, it appears above each symbol. MEAN is ignored unless you also use the SUMVAR= option.
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. However, 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 This is true regardless of what is specified in the SYMBOL statement.
NOMARKER
suppresses drawing the marker symbol. This is true regardless of what is specified in the SYMBOL statement.
PERCENT
displays the percentages of observations that have a given value for the plot variable above each plot data point. If symbols are used, it appears above each symbol.
Alias:PCT
Restriction:The PERCENT option is ignored if the CPERCENT option is specified.
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>
Restriction:Any response values that exceed the highest tick mark value are not plotted.
Note: The overlay plot line connects only the visible plot response values.
REF= value | (value) | (value-list)
draws reference lines at the specified points using the chart response axis. See MIDPOINTS=value-list 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.
SUM
displays the sum statistic above each plot data point. If symbols are used, it appears above each symbol.
Restrictions:The SUM option is ignored unless you also use the SUMVAR= option.

This option is ignored if the MEAN option is specified.

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.
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 the FREQ= option to calculate percentages or frequencies based on a sum.
URL=character-variable
specifies a character variable whose values are URLs. The variable values are URLs for Web pages to display when the user clicks (drills down) on elements in the graph.
Restrictions: This option affects graphics output that is created through the ODS HTML destination only.

Not supported by GIF, PNG, and ACTIVEX devices.

Interaction:If you specify both the HTML= and the URL= options, then the URL= option is ignored.

Example: GIF Output with Drill-Down Links

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 (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

Details

Using the PLOT Statement

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 option description for SUMVAR=plot-variable.

Description

The PLOT statement specifies one plot request. You can use multiple PLOT statements to generate multiple plots. The PLOT statement automatically does the following:
  • scales the plot response (right) axis to include the maximum and minimum data values
  • plots data points within the axis and connects them from left to right
  • labels the plot response axis and displays each major tick mark value
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 interpolation. For more information, see the 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.

About SYMBOL Definitions

How SAS/GRAPH Generates and Assigns SYMBOL Definitions

SYMBOL statements control the appearance of plot symbols and lines. They can specify the following attributes:
  • the shape, size, and color of the plot symbols that mark the data points
  • the plot line style, color, and width
  • an interpolation method (either JOIN, NEEDLE, STEP, or NONE) for plotting data
  • how missing values are treated in interpolation calculations
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 the SYMBOL Statement for a complete discussion of its features.

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:
  • connect data points with straight lines (JOIN)
  • produce overlay plots with unconnected data points (NONE)
  • use a step function to connect the data points (STEP)
For bar-line charts, points on the plot overlays are automatically connected by default, which is equivalent to specifying the JOIN interpolation method.
The SYMBOL Statement describes the JOIN, STEP, and NONE interpolation methods.