2.2.4.17.31 GraphLayer::Rescale

Description

It rescales the graphic layer axes to show all dataplot points that may be outside the current axis ranges.

Syntax

BOOL Rescale( DWORD dwCntrl = 0, int * lpnOutcome = NULL )

Parameters

dwCntrl
[input] bits to control the rescale options, ANL_* in oc_const.h. You can use OKAXISTYPE_X, OKAXISTYPE_Y to prevent that axis direction to be changed, and there are many other bits that control other details.
lpnOutcome
[output] indicate if rescale has actually taken place, -1 if not due to ANL_CHK_DATA_OUTSIDE is specified but no data significantly outside

Return

TRUE if OK, otherwise FALSE.

Examples

EX1

// rescale the active graph layer by controlling to rescale X or Y only, or rescale both
void GraphLayer_Rescale_ex1(int nDirection) //0 = both XY, 1 = X only, 2 = Y only
{
	GraphLayer	gl = Project.ActiveLayer();
	DWORD		dwCntrl = ANL_NO_ROUNDING;	//do not round From/To to major ticks		
	if(1 == nDirection)
		dwCntrl |= OKAXISTYPE_Y;//prevent Y to be modified
	else if(2 == nDirection)
		dwCntrl |= OKAXISTYPE_X;//prevent X to be modified
	
    gl.Rescale(dwCntrl);
}

Remark

See Also

Header to Include

origin.h