SetAxisRange
int SetAxisRange (int panelHandle, int controlID, int xAxisScaling, double xminXinit, double xmaxXinc, int yAxisScaling, double ymin, double ymax);
Purpose
![]() |
Note This function does not support the right y-axis and has been superseded by SetAxisScalingMode. |
Sets the scaling mode and the range of the x- and y-axes for a graph or strip chart control.
For a strip chart control x-axis, the x-offset and x-increment are set rather than the min and max.
To set the x-offset and x-increment for a strip chart, use the ATTR_XAXIS_GAIN and ATTR_XAXIS_OFFSET attributes.
Supported Controls
You can use SetAxisRange 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. | ||||||||
xAxisScaling | int | Scaling mode for the x-axis. The following table lists valid values.
|
||||||||
xminXinit | double | For a graph, xmin specifies the minimum axis range when you configure the x-axis for manual scaling. In this case, xmax must exceed xmin. For a strip chart, xinit specifies the initial x-axis value. The default value is 0.0. |
||||||||
xmaxXinc | double | For a graph, xmax specifies the maximum axis range when you configure the x-axis for manual scaling. In this case, xmax must exceed xmin. For a strip chart, xinc specifies the x-axis increment for each new point. The default value is 1.0. |
||||||||
yAxisScaling | int | Scaling mode for the y-axis. The following table lists valid values.
|
||||||||
ymin | double | The minimum axis range when you configure the y-axis for manual scaling. In this case, ymax must exceed ymin. The default value is 0.0. |
||||||||
ymax | double | The maximum axis range when you configure the y-axis for manual scaling. In this case, ymax must exceed ymin. The default value is 1.0. |
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 3.0 and later
Example
Refer to userint\graphcursors.cws for an example of using the SetAxisRange function.