Plotting Dates in Graphs

In this section:

Numeric fields containing dates are recognized by the field formats specified in the Master File. Such fields can be used in ACROSS or BY phrases in GRAPH requests. To review the various format types, refer to the Describing Data With WebFOCUS Language manual.

Plotted dates are handled in the following manner:

You can selectively combine groups of date point plots to reduce the number of separate points on the horizontal axis. You do this with the IN-GROUPS-OF option. For example, if the date field format is I6YMD, you can display the data by month rather than by day by grouping it in 30-day increments:

ACROSS DATE IN-GROUPS-OF 30

This eliminates plot points for individual days. If your date format is YMD, you can redefine the format and divide the field contents by 100 to eliminate the days:

DATE/I4YM=DATE/100

Top of page

Example: Including Date Fields in a Graph

The following example illustrates how month-first formatted date fields are displayed in a graph.

SET GRMERGE = ON
GRAPH FILE GGORDER
SUM QUANTITY
ACROSS ORDER_DATE
BY PRODUCT_DESC
WHERE PRODUCT_DESC EQ 'French Roast' OR 'Hazelnut' OR 'Kona' AND
ORDER_DATE GE '010197'
END

The output is:


Top of page

x
Basic Date Support for X and Y Axes

Reference:

OLDDATES can be manipulated accordingly with the usage of YRTHRESH and DEFCENT SET parameters. If you do not specify the YRTHRESH and DEFCENT commands for dates with the Y format (for example, YMD, MDY, DMY, YM, etc.), the code will assume the format 19XX.



x
Reference: Date Support Limitations

Top of page

x
Formatting Dates for Y-Axis Values

You can display date-formatted numbers for Y-axis fields and on tool tips. The following date formats are supported:

Display Format

Corresponding WebFOCUS Format

yy/mm/dd

YMD

yy/mm

YM

mm/dd/yyyy

MDYY

mm/dd/yy

MDY

mm/dd

MD

For complete details on date formats, see the Describing Data With WebFOCUS Language manual.


WebFOCUS