Adding Labels to a Graph

In this section:

Adding labels to your graph helps provide important information about what the data in your graph represents. You may choose to add headings and/or footings to your graph, as well as horizontal (X) and vertical (Y) axis labels.

You can add a heading or footing to your graph using the HEADING or FOOTING phrase. The syntax is the same as that used for headings and footings in TABLE requests. You can also embed field values in graph headings and footings. This capability is particularly useful for annotating graphs that contain multiple sort fields.

For details on headings, footings, and embedded fields, see Using Headings, Footings, Titles, and Labels.

Note: If your graph labels or legends are not appearing correctly when you run your graph, see How to Change Color Settings for details on correcting this.

Example: Adding a Heading and Footing to a Graph

The following illustrates how to add a heading with an embedded field value to your graph. In this example, the heading is "Total Coffee Orders" with the embedded field TOT.QUANTITY.

GRAPH FILE GGORDER
HEADING CENTER
"Total Coffee Orders: <TOT.QUANTITY "
SUM QUANTITY 
BY PRODUCT_DESC
WHERE PRODUCT_DESC EQ 'French Roast' OR 'Hazelnut' OR 'Kona'
FOOTING CENTER
"For year-end orders"
END

The output is:

Adding Vertical (Y-axis) and Horizontal (X-axis) Labels to a Graph

Vertical (Y-axis) and horizontal (X-axis) graph labels are placed on the graph according to the display fields and sort fields specified in the request. The titles that appear on the graph are the titles that appear in the Master File for that particular field.

The vertical (Y-axis) title of the graph is determined by the display field. Note that when the number of Y-axis labels is greater than one, the labels do not appear along the Y-axis. Instead, the labels appear in a legend that provides the names of the fields being graphed.

The horizontal (X-axis) title of the graph is determined by the sort field.

You can replace a title by using an AS phrase in the GRAPH request.