Chapter Contents

Previous

Next
The GCHART Procedure

STAR Statement


Creates star charts in which the length of the spines represents the value of the chart statistic for each category of data or midpoint.

Requirements: At least one chart variable is required.
Global statements: FOOTNOTE, PATTERN, TITLE,
Supports: Drill-down functionality (slices only)



Description

The STAR statement specifies the variable or variables that define the categories of data to chart. This statement automatically

If all the data to be charted with the STAR statement are positive, the center of the star represents 0 and the outside circle represents the maximum value. If negative values are calculated for the chart statistic, the center represents the minimum value in the data. You can specify other values for the center and outside of the circle with the STARMIN= and STARMAX= options.

You can also use statement options to select or order the midpoints, to change the type of chart statistic, and to modify the appearance of the chart, including the content and position of the spine or slice labels, and patterns that fill the slice. You can specify additional variables by which to group or sum the data.

Star charts allow grouping, which creates two or more separate charts that display in rows or columns on one graph.

In addition, you can use global statements to modify patterns as well as add titles, footnotes, and notes to the chart. You can also use an Annotate data set to enhance the chart.

Syntax

STAR chart-variable(s) </ option(s);>

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


Required Arguments

chart-variable(s)
specifies one or more variables that define the categories of data to chart. Each chart variable draws a separate chart. All variables must be in the input data set. Separate multiple chart variables with blanks.
See also: About Chart Variables


Options

Options in a STAR statement affect all of the 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 SAS/GRAPH Colors.

ACROSS=number-of-columns
draws number-of-columns stars across the procedure output area. ACROSS= is ignored unless you also use the GROUP= option. By default, ACROSS=1. If number-of-columns calls for more stars than fit horizontally in the graphics area of the output device, no stars are drawn and an error message is written to the SAS log.

If you also use the DOWN= option, the star charts are drawn in left-to-right and top-to-bottom order.

ANGLE=degrees
starts the first slice at the specified angle. A value of 0 for degrees corresponds to the 3 o'clock position. Degrees can be either positive or negative. Positive values move the starting position counterclockwise; negative values move the starting position clockwise.

If the star chart uses spines instead of slices, degrees specifies the angle of the position halfway between the first spine and the last spine.

By default, ANGLE=0, which places the first spine or the center of the first slice of the star at the 0 degree position. Successive star spines or slices are drawn counterclockwise from the starting position.

ANNOTATE=Annotate-data-set
ANNO=Annotate-data-set
specifies a data set to annotate charts that are produced by the STAR statement.

Note:   Annotate coordinate systems 1, 2, 7, and 8 (data system coordinates) are not valid with star charts.  [cautionend]
See also: The Annotate Data Set

CFILL=fill-color
specifies one color for all slices in the chart, regardless of whether the fill is solid or hatch. If no pattern is specified on the PATTERN statement or with the FILL= option, the procedure starts with the default solid fill and then, beginning with P2N0, uses each default star hatch pattern with the specified color. For the outline color, the procedure uses the foreground color, which is the first color in the colors lists. Use COUTLINE= to specify a different outline color. CFILL= overrides any other pattern color specification and controls the color of all slices.

COUTLINE=star-outline-color | SAME
specifies the color for the circle that surrounds the star chart and for the slice outlines or spines.

SAME specifies that the outline color of a slice is the same as the interior pattern color. Specifying COUTLINE=SAME affects only slice outlines and has no effect on the color of the circle.

The default circle color is the first color in the colors list (the foreground color).

The default slice outline color depends on the PATTERN statement:

Note:   If you specify empty patterns, (VALUE=PEMPTY in a PATTERN statement) you should not change the outline color from the default value, SAME, to a single color. Otherwise all the outlines will be one color and you will not be able to distinguish between the empty areas.  [cautionend]
See also: Selecting Patterns for the Star Charts and About Patterns
Featured in: Charting a Discrete Numeric Variable in a Star Chart

CTEXT=text-color
specifies a color for all text on the chart. Text includes all slice labels, the chart heading, and group headings if grouping is used.

If you omit CTEXT=, PROC GCHART searches for a color specification in this order:

  1. the CTEXT= option in a GOPTIONS statement

  2. the first color in the colors list (the default).

The MATCHCOLOR option overrides the CTEXT= option for star slice labels.

DESCRIPTION='entry-description'
DES='entry-description'
specifies the description of the catalog entry for the chart. The maximum length for entry-description is 40 characters. The description does not appear on the chart. By default, the GCHART procedure assigns a description of the form STAR CHART OF variable, where variable is the name of the chart variable.

The entry-description can include the #BYLINE, #BYVAL, and #BYVAR substitution options, which work as they do when used on TITLE, FOOTNOTE, and NOTE statements. For more information, refer to the description of the options, and Substituting BY Line Values in a Text String. The 40-character limit applies before the substitution takes place for these options; thus, if in the SAS program the entry-description text exceeds 40 characters, it is truncated to 40 characters, and then the substitution is performed.

The descriptive text is shown in the "description" portion of each of the following:

DISCRETE
treats a numeric chart variable as a discrete variable rather than as a continuous variable. The GCHART procedure creates a separate midpoint and, hence, a separate star slice for each unique value of the chart variable. If the variable has a format associated with it, each format value is treated as a separate value.

The LEVELS= option is ignored when you use the DISCRETE option. The MIDPOINTS= option overrides the DISCRETE option.
Featured in: Charting a Discrete Numeric Variable in a Star Chart

DOWN=number-of-rows
draws number-of-rows stars vertically in the procedure output area. The DOWN= option is ignored unless you also use the GROUP= option. If number-of-rows calls for more stars than fit vertically in the graphics area of the output device, no stars are drawn and an error message is written to the SAS log.

If you also use the ACROSS= option, the stars are drawn in left-to-right and top-to-bottom order.

FILL=SOLID | X
specifies the fill pattern for all slices in the star chart:

SOLID
S
rotates a solid fill through the colors list as many times as necessary. This is the default.

X
rotates a single hatch pattern through the colors list as many times as necessary.

If you use default device colors (the COLORS= option is omitted), the fill skips the first color in the colors list.

FILL= overrides any patterns that are specified in PATTERN statements.

By default, the fill patterns take the colors from the current colors list in rotation. If any PATTERN statements have been defined, the colors in the PATTERN definitions are used, in order, before the default color rotation.
Featured in: Charting a Discrete Numeric Variable in a Star Chart

FREQ=numeric-variable
specifies a variable whose values weight the contribution of each observation in the computation of the chart statistic. Each observation is counted the number of times that are specified by the value of numeric-variable for that observation. If the value of numeric-variable is missing, 0, or negative, the observation is not used in the statistic calculation. Noninteger values of numeric-variable are truncated to integers.

FREQ= is valid with all chart statistics.

Because you cannot use TYPE=PERCENT or TYPE=FREQ with the SUMVAR= option, you must use FREQ= to calculate percentages and frequencies based on a sum.
See also: Calculating Weighted Statistics

GROUP=variable
organizes the data according to values of group-variable and produces a separate star chart for each unique value of group-variable. Group-variable can be either character or numeric and is always treated as a discrete variable. Missing values for group-variable are treated as a valid group.

By default, the charts are produced in ascending order of group variable value and each is drawn on a separate page or display. Therefore, the effect of GROUP= is essentially the same as using a BY statement except that GROUP= causes the midpoints with the same value to use the same color and fill pattern. To place more than one star chart on a page or display, use the ACROSS= or DOWN= options, or both.

HTML=variable
identifies the variable in the input data set whose values create links in the HTML file that is created by the ODS HTML statement. These links are associated with an area of the chart and point to the data or graph that you wish to display when the user drills down on the area. Only star charts with slices support drill-down.

LEVELS=number-of-midpoints
specifies number of midpoints for a numeric chart variable. The range for each midpoint is calculated automatically using the algorithm described by Terrell and Scott (1985). LEVELS= is ignored if

MATCHCOLOR
uses the slice pattern color for all slice labels. MATCHCOLOR overrides the color that is specified in the CTEXT= option. If the chart uses spines instead of slices, the spine color is used for the slice label and value text.

MIDPOINTS=value-list
specifies the midpoint values for the slices. The way you specify value-list depends on the type of variable:

For a complete description of value-list, see the ORDER= option in the AXIS statement.
See also: About Midpoints

MIDPOINTS=OLD
tells the GCHART procedure to calculate default midpoints using the algorithm that is used in Release 82.4 and Version 5 of SAS/GRAPH. The MIDPOINTS=OLD option is ignored unless the chart variable is numeric type.

MISSING
accepts a missing value as a valid midpoint for the chart variable. By default, observations with a missing value are ignored. Missing values are always valid for the group variable.

NAME='entry-name'
specifies the name of the catalog entry for the graph. The maximum length for entry-name is eight characters. The default name is GCHART. If the name duplicates an existing entry name, SAS/GRAPH software adds a number to the duplicate name to create a unique name- for example, GCHART1.

NOCONNECT
draws only star spines without connecting lines. By default, the spines are connected to form slices.
Featured in: Charting a Discrete Numeric Variable in a Star Chart

NOGROUPHEADING
suppresses the headings normally printed above each star when you use the GROUP= option.

NOHEADING
suppresses the heading normally printed at the top of each page or display of star chart output.
Featured in: Charting a Discrete Numeric Variable in a Star Chart

PERCENT=ARROW | INSIDE | NONE | OUTSIDE
prints the percentage represented by each slice using the specified labeling method. For a description of the option values see Selecting and Positioning Spine and Slice Labels. By default, PERCENT=NONE (percentage is not displayed).

SLICE=ARROW | INSIDE | NONE | OUTSIDE
controls the position and style of the slice name (midpoint value) for each slice. For a description of the option values, see Selecting and Positioning Spine and Slice Labels. By default, SLICE=OUTSIDE (the name is outside the slice).

STARMAX=max-value
scales the chart so that the outside (or edge) of the circle represents the value that is specified by max-value. By default, the value for STARMAX= is the maximum chart statistic value.

STARMIN=min-value
scales the chart so that the center of the circle represents the value that is specified by min-value. By default, STARMIN=0. If the chart statistic has negative values, by default the value for STARMIN= is the minimum chart statistic value.

SUMVAR=summary-variable
specifies a numeric variable for sum or mean calculations. The GCHART procedure calculates the sum or, if requested, the mean of the value of numeric-variable for each midpoint. The resulting statistics are represented by the size of the slice and displayed beside each slice.

When you use SUMVAR=, the TYPE= option must be either SUM or MEAN. With SUMVAR=, the default is TYPE=SUM.
Featured in: Specifying the Sum Statistic in a Star Chart

TYPE=statistic
specifies the chart statistic.

Because you cannot use TYPE=FREQ or TYPE=PERCENT with SUMVAR=, you must use FREQ= to calculate percentages or frequencies based on a sum. See also Calculating Weighted Statistics.
See also: About Chart Statistics

VALUE=ARROW | INSIDE | NONE | OUTSIDE
controls the position and style of the slice value (chart statistic) for each slice. For a description of the option values, see Selecting and Positioning Spine and Slice Labels. By default, VALUE=OUTSIDE (the value is outside of the slice).

WOUTLINE=slice-outline-width
specifies the width of the outline in pixels. WOUTLINE= affects both the slice and the subgroup outlines.


Selecting and Positioning Spine and Slice Labels

By default, each spine or slice is labeled with its midpoint value and its chart statistic value, which are printed outside of the circle. You can control where and how these labels are displayed with the SLICE= and VALUE= options, respectively. In addition, each spine can display the percentage that its midpoint contributes to the total chart statistic (spine percent). Use the PERCENT= option to request spine percent.

The SLICE=, VALUE=, and PERCENT= options use the same values:

ARROW
places the text outside of the star circle and connects the text to the circle with a line. The line points to the spine or the center of the slice. The arrow uses the color that is specified by CTEXT= in the STAR statement. If you omit CTEXT=, the arrow uses the first color in the colors list.

INSIDE
places the text inside the star circle.

NONE
suppresses the text.

OUTSIDE
places the text outside the star circle.

Slice Labeling Methods illustrates these values.

The SLICE= and VALUE= options are dependent on each other. If you specify only VALUE= or only SLICE=, the other option automatically uses the same labeling method. PERCENT= is independent of these two.

Be careful about the combinations that you specify. For example, if you specify PERCENT=ARROW and VALUE=OUTSIDE, the line that connects the percentage information to each spine may overlay the statistic value.


Selecting Patterns for the Star Charts

Star charts are always patterned by midpoint.

Default patterns and outlines

Each slice in a star chart is filled with a pattern. By default, the procedure

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

Controlling patterns

You can control slice patterns and their outlines in several ways.

See About Patterns for more information on how the GCHART procedure uses patterns and outlines. See PATTERN Statement for a description of default pie/star patterns.


Modifying the Statistic Heading and the Group Heading

By default, the procedure prints a heading at the top of each chart indicating the type of statistic charted and the name of the chart variable--for example, SUM of SALES by SITE. You can suppress this heading with the NOHEADING option.

When you use the GROUP= option, a heading is printed above each star indicating the name of the group variable and its value for the particular star--for example, SITE=Paris. You can suppress these headings with the NOGROUPHEADING option. You can also suppress the variable name SITE= so that only the value Paris remains. To do this, use a LABEL statement and assign a null value to the variable name, as shown in this example:

label site='00'x;

Because the AXIS statement cannot be used by the STAR statement, you should use the FTEXT= and HTEXT= graphics options to control the font and height of text on the chart. Increasing the value of HTEXT= decreases the size of the star if any slice labels are positioned outside. For a description of these graphics options, see Graphics Options and Device Parameters Dictionary.


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.