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 TIBCO 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
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:
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.
The default date format for the X and Y axes is MEDIUM. You can overwrite the default by using one of the following API calls (where xx is one of the numbers listed above):
setTextFormatPreset(getX1Label(),xx); // for X Axis
setTextFormatPreset(getY1Label(),xx); // for Y Axis
The default date format for Data Text is LONG. This only applies to graphs with dates on the Y axis. Currently this format is not supported on the X axis. You can overwrite the default by using the following API call:
setDataTextFormat(xx);
For more information, see Customizing Graphs Using the Graph API and HTML5 JSON Properties.
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 TIBCO WebFOCUS® Language manual.