Selecting Values for the X and Y Axes

In this section:

The values you select for the X- and Y-axes determine what data is included in the graph you are creating, and how it appears.

The X-axis value is determined by the sort phrase (BY or ACROSS) used in your GRAPH request. At least one sort phrase is required in every GRAPH request. When there are multiple BY phrases or when an ACROSS and BY phrase are included in the same request, multiple graphs are generated, one for each combination of values for the fields referenced in the request. For details, see Creating Multiple Graphs.

The Y-axis value is determined from the display field associated with the display command (SUM or PRINT) issued in your GRAPH request.

You can also:

Example: Selecting Values for the X and Y Axes

The following illustrates how to set the X-axis (PRODUCT_DESC) using an ACROSS phrase and the Y-axis (QUANTITY) with the display command SUM:

GRAPH FILE GGORDER
SUM QUANTITY AS 'Ordered Units'
ACROSS PRODUCT_DESC
END

The output is:

Hiding the Display of a Y-Axis Field

You can hide the display of a Y-axis field in a graph. This option is useful when you want to temporarily remove a particular Y-axis field while retaining all of the original graph properties.

To temporarily hide the display of a Y-axis field, add the NOPRINT command to the field. Although the NOPRINT command applies to both verb objects and sort fields in a TABLE request, it only applies to verb objects in a GRAPH request.

Interpolating X and Y Axis Values Using Linear Regression

You can interpolate X and Y axis values using basic linear regression. Basic linear regression involves the average of the summation of X and Y axis values to determine a linear equation that expresses the trend of the scatter diagram. Use the SET parameter GTREND to turn on basic linear regression in your graph.

GTREND is only available for use with scatter charts.

Example: Interpolating X and Y Axis Values Using Linear Regression

The following illustrates how to turn on linear regression in a scatter chart.

SET 3D=OFF
GRAPH FILE CAR
PRINT RC
ACROSS DC
ON GRAPH SET LOOKGRAPH SCATTER
ON GRAPH SET GTREND ON
END

The output is: