Creating Line and Other Plots Using SAS Enterprise Guide

This section discusses the means by which line and other plots were created with SAS IT Resource Management 2.7 and the recommended means by which they are created using SAS IT Resource Management 3.2.

About Line and Other Plots

The following table shows the 15 plot types or options that are available in SAS IT Resource Management 2.7 and the corresponding SAS Enterprise Guide tasks that are available to generate those chart types in SAS IT Resource Management 3.2.
SAS IT Resource Management 2.7 Plot Types and Corresponding SAS Enterprise Guide Tasks
Plot Type
SAS Enterprise Guide Task
2XY
Line Plot task
Line
Line Plot task
Join
Line Plot task
Needle
Line Plot task
Smooth
Line Plot task
Spline
Line Plot task
Standard Deviation
Line Plot task
Step Center
Line Plot task
Percent
Line Plot task
Scatter
Scatter Plot task
Stack
Area Plot task
Stack Percent
Area Plot task
Box Plot
Box Plot task
Hi-Low plot
Box Plot task
Regression
Various regression plots in the Analyze category of plots
This section provides more detail about the SAS IT Resource Management 2.7 macro that creates various types of plots and the equivalent SAS Enterprise Guide steps that are required to recreate these types of reports.
The %CPPLOT1 macro is used to create the following plot types:
  • one analysis column and one class column as shown in the following examples:
  • multiple analysis columns (scatter plot – Example 14)
  • multiple analysis columns and one class column as shown in the following examples:
  • one analysis column, one class column, and one group column as shown in the following examples:
The %CPPLOT2 macro creates a line plot that is named 2XY Plot with Multiple Analysis Columns and One Class Column (Example 19).

Line and Other Plot Notes

Here are some notes that you might consider when working with plot reports:
  • Do not confuse the Group role that is available in some plot tasks, with the Group charts by role. The Group charts by role is a role that is available in most report tasks. It enables you to create a different report page for each value of the Group charts by column.
  • The graph examples in the following sections typically show two analysis columns wherever multiple analysis columns are supported.

Example 10

Line Plot with One Analysis Column and One Class Column

Line Plot with One Analysis Column and One Class Column
  1. Select the Line Plot task.
  2. Select the Line Plot subtask.
  3. Assign one analysis column to the Vertical role.
  4. Assign one date or time class column to the Horizontal role.
  5. (Optional) Assign one or more class columns to the Group charts by role.

Example 11

Step Plot with One Analysis Column and One Class Column

Step Plot with One Analysis Column and One Class Column
  1. Select the Line Plot task.
  2. Select the Step Plot subtask.
  3. Assign one analysis column to the Vertical role.
  4. Assign one date or time class column to the Horizontal role.
  5. (Optional) Assign one or more class columns to the Group charts by role.

Example 12

Box Plot with One Analysis Column and One Class Column

Box Plot with One Analysis Column and One Class Column
  1. Select the Box Plot task.
  2. Select the Box Plot subtask.
  3. Assign one analysis column to the Vertical role.
  4. Assign one date or time class column to the Horizontal role.
  5. (Optional) Assign one or more class columns to the Group charts by role.

Example 13

Hi-Low Plot with One Analysis Column and One Class Column

Hi-Low Plot with One Analysis Column and One Class Column
  1. Select the Box Plot task.
  2. Select the Hi-Low subtask.
  3. Assign one analysis column to the Vertical role.
  4. Assign one date or time class column to the Horizontal role.
  5. (Optional) Assign one or more class columns to the Group charts by role.

Example 14

Scatter Plot with Two Analysis Columns

Scatter Plot with Two Analysis Columns
  1. Select the Scatter Plot task.
  2. Select any of the Scatter Plot subtasks.
  3. Assign one analysis column to the Vertical role.
  4. Assign one analysis column to the Horizontal role.
  5. (Optional) Assign one or more class columns to the Group charts by role.

Example 15

Line Plot with Two Analysis Columns and One Class Column

Line Plot with Two Analysis Columns and One Class Column
  1. Select the Line Plot task.
  2. Select the Multiple vertical column line plots using overlay subtask.
  3. Assign two analysis columns to the Vertical role.
  4. Assign one date or time class column to the Horizontal role.
  5. (Optional) Assign one or more class columns to the Group charts by role.

Example 16

Stack Plot with Two Analysis Columns and One Class Column

Stack Plot with Two Analysis Columns and One Class Column
  1. Select the Stack Columns task located in the Data category to transpose and accumulate your data.
  2. Assign the two analysis columns that you want to plot to the Columns to Stack role.
  3. Assign all of the class columns used in your report (including Group charts by columns) to the Group Analysis by role.
  4. Rename your new column labels (see Stack Columns Task (Reference 1)).
  5. Insert SAS custom code to accumulate your data. See Custom User Code to Accumulate Stacked Data (Reference 2).
  6. Run the Stack Columns task to transpose and accumulate your data.
  7. Select the Area Plot task.
  8. Select the Multiple area plots by group column subtask.
  9. Assign the new transposed analysis columns to the Vertical role.
  10. Assign the new transposed class column to the Group role.
  11. Assign one date or time class column to the Horizontal role.
  12. (Optional) Assign one or more class columns to the Group charts by role.

Example 17

Line Plot with One Analysis Columns, One Class Column, and One Group Column

Line Plot with One Analysis Columns, One Class Column, and One Group Column
  1. Select the Line Plot task.
  2. Select the Multiple line plots by group column subtask.
  3. Assign one analysis column to the Vertical role.
  4. Assign one date or time class column to the Horizontal role.
  5. Assign one class column to the Group role.
  6. (Optional) Assign one or more class columns to the Group charts by role.

Example 18

Stack Plot with One Analysis Columns, One Class Column, and One Group Column

Stack Plot with One Analysis Columns, One Class Column, and One Group Column
  1. Select the Stack Columns task located in the Data category to transpose and accumulate your data.
  2. Assign one analysis column that you want to plot to the Columns to Stack role.
  3. Assign all of the class columns used in your report (including Group charts by columns) to the Group Analysis by role. Ensure that the class column that you want to accumulate in Step 5 is the last column in the list.
  4. Rename your new column labels. See Stack Columns Task (Reference 1).
  5. Insert SAS Custom Code to accumulate your data. See Custom User Code to Accumulate Stacked Data (Reference 2).
  6. Run the Stack Columns task to transpose and accumulate your data.
  7. Select the Area Plot task.
  8. Select the Multiple area plots by group column subtask.
  9. Assign the new transposed analysis columns to the Vertical role.
  10. Assign one date or time class column to the Horizontal role.
  11. Assign one class column to the Group role.
  12. (Optional) Assign one or more class columns to the Group charts by role.

Example 19

2XY Plot with Two Analysis Columns and One Class Column

2XY Plot with Two Analysis Columns and One Class Column
  1. Select the Line Plot task.
  2. Select the Line Plot subtask.
  3. Assign one analysis column to the Vertical role.
  4. Assign one analysis column to the Vertical (Right) role.
  5. Assign one date or time class column to the Horizontal role.
  6. (Optional) Assign one or more class columns to the Group charts by role.

Example 20

Three-Dimensional Graph

The three-dimensional graph that is available in SAS IT Resource Management 2.7 differs from the three-dimensional graph that is generated with SAS Enterprise Guide. In SAS Enterprise Guide, the columns for the horizontal, vertical, and depth task role must be numeric. In SAS IT Resource Management 2.7, a class column is supported.
You can use the Line Plot task in SAS Enterprise Guide to generate a plot that shows all of the information that is available in the three-dimensional graph from SAS IT Resource Management 2.7. To create this graph, see Example 17.
Line Plot with One Analysis Columns, One Class Column, and One Group Column