SetAxisTimeFormat
int SetAxisTimeFormat (int panelHandle, int controlID, int axis, int format, char formatString[]);
Purpose
Sets the format string for a graph, digital graph (x-axis only), or strip chart axis that uses the absolute time or relative time format.
If you use absolute time format, LabWindows/CVI displays axis labels as formatted strings that describe fixed points in time. When you use this format, LabWindows/CVI interprets a plotted data value as the number of seconds since midnight, January 1, 1900.
If you use relative time format, LabWindows/CVI displays axis labels as formatted strings that describe the time elapsed since a reference point. When you use this format, LabWindows/CVI interprets a plotted data data value as the number of seconds that have elapsed since the reference point.
The format string supports the same format specifiers as the strftime function with the %nf and @ extensions.
![]() |
Note The @ extension is valid only for the relative time format. |
Supported Controls
You can use SetAxisTimeFormat with the following controls:
Parameters
Input | ||
Name | Type | Description |
panelHandle | int | Specifier for a particular panel that is currently in memory. You can obtain this handle from functions such as LoadPanel and NewPanel. |
controlID | int | The defined constant, located in the .uir header file, that you assigned to the control in the User Interface Editor, or the ID returned by functions such as NewCtrl and DuplicateCtrl. |
axis | int | The axis for which you want to set the format string. For graphs, you must specify one of the following values: VAL_BOTTOM_XAXIS, VAL_TOP_XAXIS, VAL_LEFT_YAXIS, or VAL_RIGHT_YAXIS. For strip charts, you must specify VAL_LEFT_YAXIS or VAL_BOTTOM_XAXIS. For digital graphs, you must specify VAL_BOTTOM_XAXIS. |
format | int | The time format for which you want to change the format string. You must specify either VAL_ABSOLUTE_TIME_FORMAT or VAL_RELATIVE_TIME_FORMAT. If you specify VAL_ABSOLUTE_TIME_FORMAT, LabWindows/CVI displays axis labels as formatted strings that describe fixed points in time. If you specify VAL_RELATIVE_TIME_FORMAT, LabWindows/CVI displays axis labels as formatted strings that describe the time elapsed since a reference point. |
Return Value
Name | Type | Description |
status | int | Return value indicating whether the function was successful. A negative number indicates that an error occurred. |
Additional Information
Library: User Interface Library
Include file: userint.h
LabWindows/CVI compatibility: LabWindows/CVI 8.0 and later