The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



SetRange


Unit:SDL_rchart
Class:TRChart
Declaration:procedure SetRange (Layer: integer; xLo, yLo, xHi, yHi: extended);

The method SetRange sets the extents of a layer at once and redraws it using the new scaling of the layer addressed by the parameter Layer. If Layer is zero, all layers are affected by the method, setting all axes to the specified range. The parameters xLo, yLo, xHi, and yHi specify the ranges of the x- and the y-axis. This method is of importance for cases where the range of a chart should be adjusted dynamically (e.g. following the movement of a mouse) because of avoiding any unnecessary calculation of the scales.

In case of invalid parameters (e.g. negative values with logarithmic scales) SetRange is not executed at all (no exception is generated). If any of the axes has no extent (i.e. xLo =xHi, or yLo =yHi ), the range of the axis is automatically set to +/-ScalePropsX[].MinRange/2 and ScalePropsY[].MinRange/2, respectively, of the mid value.

Hint 1: In order to set the ranges in a way that all graphics elements are visible, the method AutoRange can be used.

Hint 2: Please note that the number of layers is restricted to two in the Light Edition of the SDL Suite.

Example: This method is used in the following example programs (see http://www.lohninger.com/examples.html for downloading the code): cluster, geodata, kohmap, multilinreg, printcht, processc, rchfifo, rchzoomp, rcshared, rctstspd



Last Update: 2013-May-30