SGPLOT Procedure

WATERFALL (Preproduction) Statement

Creates a waterfall chart computed from input data. In the chart, bars represent an initial value of Y and a series of intermediate values identified by X leading to a final value of Y.
About Waterfall Charts (Preproduction)

Syntax

WATERFALL CATEGORY=variable RESPONSE= numeric-variable </ option(s)>;

Summary of Optional Arguments

Bar options
specifies the width of the bars as a ratio of the maximum possible width.
specifies a variable that is used to discretely color the bars.
specifies a special effect to be used on all filled bars.
specifies whether the bars are filled.
specifies the color of the fill for the bars.
specifies the appearance of the final bar, if displayed.
specifies the tick value used on the X axis for the final bar, if displayed.
specifies the appearance of the initial bar, if displayed.
specifies the tick value used on the X axis for the initial bar, if displayed.
specifies the value of the initial bar.
processes missing values as a valid category value and creates a bar for it.
specifies whether the bars have outlines.
specifies the statistic for the response axis.
Label options
displays a label for each data point.
specifies the appearance of the labels in the plot when you use the DATALABEL= option.
Plot options
specifies the value of the ID variable in an attribute map data set.
specifies a name for the plot.
specifies the degree of transparency for the bars.
specifies a character variable that contains URLs for Web pages to be displayed when parts of the plot are selected within an HTML page.
assigns the variables that are assigned to the primary (bottom) horizontal axis to the secondary (top) horizontal axis.
assigns the variables that are assigned to the primary (left) vertical axis to the secondary (right) vertical axis.

Required Arguments

CATEGORY= variable
specifies the variable for the category values. Duplicated category values are summarized into a unique value. All values are treated as discrete.
RESPONSE= numeric-variable
specifies the variable for the response values.

Optional Arguments

ATTRID= variable
specifies the value of the ID variable in an attribute map data set. You specify this option only if you are using an attribute map to control visual attributes of the graph. For more information, see Using SG Attribute Maps to Control Visual Attributes.
BARWIDTH= numeric-value
specifies the width of the bars as a ratio of the maximum possible width. The maximum width is equal to the distance between the center of each bar and the centers of the adjacent bars. Specify a value from 0.0 (narrowest) to 1.0 (widest).
For example, if you specify a width of 1, then there is no space between the bars. If you specify a width of .5, then the width of the bars is equal to the space between the bars.
Default:.8
COLORGROUP= variable
specifies a variable that is used to discretely color the bars. Once the variable values are found, the transaction bar colors are taken from the GraphData1 ... GraphDatan style elements in the current style. If the transaction bars are filled, then the COLOR attribute is used for the fill. The CONTRASTCOLOR attribute is used for the transaction bar outlines.
DATALABEL <= variable>
displays a label for each data point. If you specify a variable, then the values of that variable are used for the data labels. If you do not specify a variable, then the values of the calculated response are used for the data labels.
DATALABELATTRS= style-element <(options)> | (options)
specifies the appearance of the labels in the plot when you use the DATALABEL= option. You can specify the appearance by using a style element or by using suboptions. If you specify a style element, you can also specify suboptions to override specific appearance attributes.
Here is an example that specifies a style element: DATALABELATTRS=GraphLabelText
options can be one or more of the following:
COLOR= color
specifies the color of the label characters. You can specify colors using the same color schemes that are supported by SAS/GRAPH software. For more information, see Color-Naming Schemes in SAS/GRAPH: Reference.
Default:The default color is specified by the Color attribute of the GraphDataText style element in the current style.
FAMILY= “font-family
specifies the font family for the label characters. The SAS ODS styles use TrueType system fonts. For more information, see TrueType Fonts Supplied by SAS in SAS Language Reference: Concepts.
Default:The default font family is specified by the FontFamily attribute of the GraphDataText style element in the current style.
SIZE= n <units>
specifies the font size of the label characters. You can also specify the unit of measurement. The default unit is pixels. For a list of measurement units that are supported, see Units of Measurement.
Default:The default font size is specified by the FontSize attribute of the GraphDataText style element in the current style.
STYLE= ITALIC | NORMAL
specifies whether the label characters are italic (ITALIC) or normal (NORMAL).
Default:The default font style is specified by the FontStyle attribute of the GraphDataText style element in the current style.
WEIGHT= BOLD | NORMAL
specifies whether the label characters are bold (BOLD) or normal (NORMAL).
Default:The default font weight is specified by the FontWeight attribute of the GraphDataText style element in the current style.
Here is an example expression:
DATALABELATTRS=(Color=Green Family=Arial Size=8 Style=Italic Weight=Bold)
Default:The default style element is GraphDataText.
Interaction:This option has no effect unless the DATALABEL option is also specified.
DATASKIN= NONE | CRISP | GLOSS | MATTE | PRESSED | SHEEN
specifies a special effect to be used on all filled bars. Specify one of the following (the samples were generated using the LISTING style):
NONE
Dataskin NONE
CRISP
Dataskin CRISP
GLOSS
Dataskin GLOSS
MATTE
Dataskin MATTE
PRESSED
Dataskin PRESSED
SHEEN
Dataskin SHEEN
Default:NONE
Interaction:This option has no effect if you specify the NOFILL option.
FILL | NOFILL
specifies whether the bars are filled. The FILL option shows the fill color for the bars. The NOFILL option hides the fill color for the bars.
Default:FILL
Interactions:Specifying FILL also hides the outlines.

If NOFILL and NOOUTLINE are both specified, then both options are ignored.

FILLATTRS= style-element | (COLOR= color)
specifies the color of the fill for the bars.
You can specify the color of the fill by using a style element or by using the COLOR= suboption. For more information about specifying colors, see Specifying Colors in SAS/GRAPH Programs in SAS/GRAPH: Reference in the “Using Colors in SAS/GRAPH Programs” chapter in the SAS/GRAPH: Reference
Here is an example that specifies a style element: FILLATTRS=GraphData3
Here is an example that specifies a color name: FILLATTRS=(COLOR= "Very light red")
Default:For ungrouped data, the default color is specified by the Color attribute of the GraphDataDefault style element in the current style. For grouped data, the default color is specified by the ContrastColor attribute of the GraphData1 ... GraphDatan style elements in the current style.
Interaction:This option has no effect if you also specify the NOFILL option.
FINALBARATTRS= style-element | (COLOR= color)
specifies the appearance of the final bar, if displayed. You can specify the color of the fill by using a style element or by using the COLOR= suboption. You can specify colors using the same color schemes that are supported by SAS/GRAPH software. For more information, see Color-Naming Schemes in SAS/GRAPH: Reference.
Default:The default color is specified by the Color attribute of the GraphFinal style element in the current style.
Interaction:This option has no effect if you specify the NOFILL option.
FINALBARTICKVALUE= “text-string
specifies the tick value used on the X axis for the final bar, if displayed.
Default:"Final"
INITIALBARATTRS= style-element | (COLOR= color)
specifies the appearance of the initial bar, if displayed. You can specify the color of the fill by using a style element or by using the COLOR= suboption. You can specify colors using the same color schemes that are supported by SAS/GRAPH software. For more information, see Color-Naming Schemes in SAS/GRAPH: Reference.
Default:The default color is specified by the Color attribute of the GraphInitial style element in the current style.
Interactions:This option has no effect if you specify the NOFILL option.

This option has no effect unless INITIALBARVALUE is also specified.

INITIALBARTICKVALUE= “text-string
specifies the tick value used on the X axis for the initial bar, if displayed.
Default:"Initial"
Interaction:This option has no effect unless INITIALBARVALUE is also specified.
INITIALBARVALUE= number
specifies the value of the initial bar. When specified, the first transaction bar to be drawn starts at that initial value instead of zero.
Default:If the INITIALBARVALUE option is not specified, the initial bar is not included in the chart and the first transaction bar is drawn from zero.
MISSING
processes missing values as a valid category value and creates a bar for it.
NAME= “text-string
specifies a name for the plot. You can use the name to refer to this plot in other statements.
Note:The name is case-sensitive. When you refer to the specified name in other statements, you must use the same exact capitalization.
OUTLINE | NOOUTLINE
specifies whether the bars have outlines. The OUTLINE option shows the outlines. The NOOUTLINE option hides the outlines.
Default:OUTLINE
Interactions:Specifying OUTLINE also hides the fill color.

If NOOUTLINE and NOFILL are both specified, then both options are ignored.

STAT= MEAN | SUM
specifies the statistic for the response axis. Specify one of the following statistics:
MEAN
the mean of the response variable.
SUM
the sum of the response variable.
Default:SUM
TRANSPARENCY= numeric-value
specifies the degree of transparency for the bars. Specify a value from 0.0 (completely opaque) to 1.0 (completely transparent).
Default:0.0
URL= character-variable
specifies a character variable that contains URLs for Web pages to be displayed when parts of the plot are selected within an HTML page.
Default:By default, no HTML links are created.
Interactions:This option affects graphics output that is created through the ODS HTML destination only. For more information about ODS destinations, see Specifying a Destination.

This option has no effect unless you also specify IMAGEMAP in the ODS GRAPHICS statement. For more information, see Using the ODS GRAPHICS Statement.

X2AXIS
assigns the variables that are assigned to the primary (bottom) horizontal axis to the secondary (top) horizontal axis.
Y2AXIS
assigns the variables that are assigned to the primary (left) vertical axis to the secondary (right) vertical axis.