.. highlightlang:: us .. index:: LayerAutoScale .. _layerautoscale: LayerAutoScale ============== .. us.tag LayerAutoScale ENGLISH LayerSet Changed5505 :ref:`LayerAutoScale` scales the diagram axes depending on the the data range of the diagram's datasets. .. function:: bool = LayerAutoScale(hLayer) bool = LayerAutoScale(hLayer, ssAxis) bool = LayerAutoScale(hLayer, ssAxis, nTicks) bool = LayerAutoScale(hLayer, ssAxis, nTicks, bOnlyForXRange) .. us.return **Return Value** If the function succeeds, the return value is TRUE (1); otherwise it is FALSE (0). .. us.params **Parameters** .. uparam:: hLayer Identifies the layer. .. uparam:: ssAxis *ssAxis* is a scalar string with the value "X", "Y" or "Z", depending on which axis should be rescaled. .. uparam:: nTicks *nTicks* is the number of major ticks in the range 2 to 50. .. uparam:: bOnlyForXRange If *bOnlyForXRange* is TRUE (1), only the y axis is scaled for the selected x-axis range. If *nTicks* is set to 0, the number of labels will be calculated automatically. Set *ssAxis* to the value "Y". .. us.comment **Comment** If the function is called with one parameter, all axes are scaled and between 6 and 11 ticks are calculated for each axis. The function returns FALSE (0), if the axis is scaled logarithmically. Before this function is called the layer should be added to a document. (see :ref:`PageAddLayer`). .. us.history **History** .. list-table:: :header-rows: 1 * - Version - Description * - R2013.5 - New parameter *bOnlyForXRange*. * - 4.2.7 - Function can be invoked with one parameter (copy constructor). The copy constructor will not copy datasets or drawing objects. .. seealso:: :ref:`overview-diagrams`, :ref:`LayerCreate`, :ref:`LayerSetLabelNum`, :ref:`PageAddLayer` :sub:`id-620231`