PIE Subcommand (IGRAPH command)

A simple pie chart summarizes categories defined by a single variable or by a group of related variables. A clustered pie chart contains a cluster of simple pies, all of which are stacked into categories by the same variable. The pies are of different sizes and appear to be stacked on top of one another. The cluster contains as many pies as there are categories in the cluster variable. For both simple and clustered pie charts, the size of each slice represents the count, the percentage, or a summary function of a variable.

The following keywords are available:

summary function. Defines a function used to summarize the variable defined on the SUMMARYVAR subcommand. If the SUMMARYVAR assignment is $COUNT or $PCT, the PIE subcommand cannot have a summary function. Otherwise, SUM, SUMAV, SUMSQ, NGT(x), NLE(x), NEQ(x), NGE(x), NGT(x), and NIN(x1,x2) are available. See the topic Summary Functions (IGRAPH command) for more information.

START num. Indicates the starting position of the smallest slice of the pie chart. Any integer can be specified for num. The value is converted to a number between 0 and 360, which represents the degree of rotation of the smallest slice.

CW | CCW. Sets the positive rotation of the pie to either clockwise ( CW ) or counterclockwise ( CCW ). The default rotation is clockwise.

SLICE. Sets the labeling characteristics for the slices of the pie. The pie slices can be labeled with the category labels (LABEL), the category percentages (PCT), the number of cases (N), and the category values (VAL). Label position is either all labels inside the pie (INSIDE) or all labels outside the pie (OUTSIDE). TEXTIN and NUMIN are no longer supported and are ignored.

STACK. Sets the labeling characteristics for the pies from stacks. This keyword is always set to LABEL so the pies are labeled with the category labels. (The PCT, N, and VAL values are no longer supported and are ignored.) Options for specifying the label position are no longer supported and are ignored. An optimal label position is always used.

Example

IGRAPH
 /SUMMARYVAR=$count
 /COLOR=VAR(volume96) TYPE=CATEGORICAL
 /EFFECT=THREE
 /PIE START 180 CW SLICE=INSIDE LABEL PCT N.
  • The pie slices represent the number of cases (SUMMARYVAR=$count) in each category of volume96 (specified on the COLOR subcommand).
  • EFFECT yields a pie chart with an additional third dimension.
  • PIE creates a pie chart.
  • The first slice begins at 180 degrees and the rotation of the pie is clockwise.
  • SLICE labels the slices with category labels, the percentage in each category, and the number of cases in each category. INSIDE places the category and numeric labels inside the pie slices .

Example

IGRAPH
 /SUMMARYVAR=VAR(sales96)
 /COLOR=VAR(volume95) TYPE=CATEGORICAL
 /X1=VAR(region) TYPE=CATEGORICAL
 /Y=VAR(division) TYPE=CATEGORICAL
 /COORDINATE=VERTICAL
 /PIE (SUM) START 0 CW SLICE=INSIDE VAL.
  • The pie slices represent the sums of sales96 values for each category of volume95 (specified on the COLOR subcommand).
  • X1 and Y define two axes representing region and division. A pie chart is created for each combination of these variables.
  • The first slice in each pie begins at 0 degrees and the rotation of the pie is clockwise.
  • SUM indicates the summary function applied to the summary variable, sales96. The pie slices represent the sum of the sales96 values.
  • SLICE labels the slices with the value of the summary function. INSIDE places the labels inside the pie slices.