In this section: |
The titles and labels that are included in the graph consist of the graph-wide titles (footnote, title, and subtitle) and ordinal and numeric axis labels and titles. All labels and titles can be defined, displayed, and auto-fitted using the properties and methods described in this section.
You can use these properties to define, display, and auto-fit the graph title, subtitle, and footnote:
You can use these properties to control the appearance of labels and titles on an ordinal axis:
You can use the ExcludeMinLabel and ExcludeMaxLabel properties to include/exclude the minimum and maximum labels on the ordinal axis.
The LabelDisplay and LabelAutofit properties determine whether labels are displayed and auto-fitted on the ordinal axis. See Label and Title Methods for methods that you can use to define ordinal axis labels.
You can use the LabelRotate, LabelStagger, and LabelWrap properties to control how labels are imaged on the ordinal axis.
You can use the LabelAutoSkip, LabelSkipBegin, and LabelSkipCount properties to omit some of the labels on the O1-axis. When LabelAutoSkip selects manual skip mode, LabelSkipBegin and LabelSkipCount properties define the beginning label and interval of labels to be omitted. When LabelAutoSkip selects automatic label skip mode, labels are omitted as necessary when the graph is made smaller in order to maintain a reasonable, readable label size (a minimum 8-point font size).
You can use the TitleAutofit, TitleDisplay, and TitleString properties to define, display, and auto-fit the title on an ordinal axis.
These properties control the appearance of labels and titles on a numeric axis:
You can use the ExcludeMinLabel and ExcludeMaxLabel properties to include/exclude the minimum and maximum labels on a numeric axis.
The LabelDisplay and LabelAutofit properties determine whether labels are displayed and auto-fitted on a numeric axis.
The LabelRotate and LabelStagger properties control how labels are imaged on a numeric axis.
The TitleAutofit, TitleDisplay, and TitleString properties define, display, and auto-fit the title on a numeric axis.
These methods control the appearance of labels and titles:
When you use these methods, you may supply an object ID as an input parameter to assign or retrieve the attribute to or from a specific label. If you do not specify a label object, the methods assign the attribute to or retrieve the attribute from the first item in the selection list. If the object ID does not identify a label object or the first item in the selection list is not a label object, a set operation applies the attribute to the object but it will not have any effect on the appearance of the graph.
Military time uses a 24-hour time format where numbers between zero (0) and one (1), or times using a 12-hour format with AM and PM indicators, are converted to times between 0:00 and 23:00. Numbers greater than one are cycled so that they map to one of these hours as well, except for cumulative military time, in which case they add to the original value.
The following table illustrates the mapping of hours between formats, using Excel general format as the initial value:
General Format |
Military Cycle |
AM/PM Cycle |
Military Cumulative |
---|---|---|---|
0 |
0:00 |
12:00AM |
0:00 |
0.25 |
6:00 |
6:00 AM |
6:00 |
0.5 |
12:00 |
12:00PM |
12:00 |
0.75 |
18:00 |
6:00PM |
18:00 |
1.00 |
0:00 |
12:00AM |
24:00 |
1.25 |
6:00 |
6:00 AM |
30:00 |
1.75 |
18:00 |
6:00PM |
42:00 |
2 |
0:00 |
12:00AM |
48:00 |
Two methods support these time formats for y-axis labels:
Format Character |
Description |
Example |
---|---|---|
G |
Era designator |
AD |
Y |
Four-digit year |
2014 |
M |
Month in year |
July or 07 |
d |
Day in month |
10 |
D |
Day in year |
360 |
E |
Day in week |
Tuesday |
F |
Day of week in month |
2 (second Wed. in July) |
h |
Hour in A.M./P.M. format (1~12) |
12 |
H |
Hour in military cycle format (0~23) |
22 |
K |
Hour in A.M./P.M. (0~11) |
10 |
m |
Minute in hour |
30 |
s |
Second in minute |
55 |
S |
Millisecond |
234 |
w |
Week in year |
40 |
W |
Week in month |
1 |
a |
A.M./PM. marker |
PM |
z |
Time zone |
Eastern Standard Time |
' |
Escape for text |
Delimiter |
" |
Single quotation mark |
` |
The default format for the SimpleDateFormat string is: HH:MM
For example:
setTextFormatPreset(getY1Label(), 32); setSimpleDateFormat("E yyyy.MM.dd 'at' hh:mm:ss a zzz");
A sample of output for these API calls is:
Sun 2004.07.18 at 04:14:09 PM PDT
The following request generates varying time values to use as the measure on the chart and displays y-axis labels in the format "E yyyy.MM.dd 'at' hh:mm:ss a zzz":
DEFINE FILE WF_RETAIL_LITE
ZZ/I11 WITH ID_SALES = ZZ + 1;
KUM/I11 WITH ID_SALES = ZZ * 5;
DATUM/YYMD WITH ID_SALES = DATEADD(TIME_DATE, 'D', ZZ);
END
GRAPH FILE WF_RETAIL_LITE
SUM DATUM
BY TIME_DATE
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET LOOKGRAPH VBAR
ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setPlace(true);
setFontSizeAbsolute(getY1Label(),true);
setFontSizeInPoints(getY1Label(),6);
setPlaceResize(getY1Label(),0);
setTextFormatPreset(getY1Label(), 32);
setSimpleDateFormat("E yyyy.MM.dd 'at' hh:mm:ss a zzz");
*END
ENDSTYLE
END
The output is:
Nested/multi-dimensional labels are supported on the O1 axis with these properties and methods:
Use the following procedures to implement the nested labels interface:
abstract int getNumLevels(); abstract int getNumLabelsOnLevel(int nLevel); abstract Vector getAllLabels(int nLevel); abstract String getLabel(int nGroup, int nLevel); abstract int getLabelGrouping(int nGroup, int nLevel);
m_chart.setO1LabelCallback (TDGNestedLabel cb);
m_chart.setNestedLabels (true);
WebFOCUS |