# SetAxisRange

int SetAxisRange (int panelHandle, int controlID, int xAxisScaling, double xminORxinit, double xmaxORxinc, int yAxisScaling, double ymin, double ymax);

## Purpose

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.

SetAxisRange does not support the right y-axis and is therefore obsolete. NI recommends that you use SetAxisScalingMode instead. To set the x-offset and x-increment for a strip chart, use the ATTR_XAXIS_GAIN and ATTR_XAXIS_OFFSET attributes.

## Parameters

Input
Name | Type | Description
panelHandle | integer | Specifier for a particular panel that is currently in memory. You obtain this handle from LoadPanel, NewPanel, or DuplicatePanel.
controlID | integer | 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 NewCtrl or DuplicateCtrl.
xAxisScaling | integer | Scaling mode for the x-axis. The following table lists valid values.
VAL_NO_CHANGE | Current x-axis scaling mode remains unchanged. xmin and xmax are not used.
VAL_MANUAL | X-axis is manually scaled, and xmin and xmax define its range.
VAL_AUTOSCALE | X-axis is autoscaled. xmin and xmax are not used. You cannot use VAL_AUTOSCALE in strip charts.
VAL_LOCK | X-axis is manually scaled using the current axis range. You cannot use VAL_LOCK in strip charts.
xminORxinit | double-precision | 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.
xmaxORxinc | double-precision | 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 | integer | Scaling mode for the y-axis. The following table lists valid values.
VAL_NO_CHANGE | Current y-axis scaling mode remains unchanged. ymin and ymax are not used.
VAL_MANUAL | Y-axis is manually scaled, and ymin and ymax define its range.
VAL_AUTOSCALE | Y-axis is autoscaled. ymin and ymax are not used. You cannot use VAL_AUTOSCALE in strip charts.
VAL_LOCK | Y-axis is manually scaled using the current axis range. You cannot use VAL_LOCK in strip charts.
ymin | double-precision | 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-precision | 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 | integer | Return value indicating whether the function was successful. A negative number indicates that an error occurred.
Code | Error Message String
xx | Success