LinearRegressionEquationWizardView.CurrentState

Syntax

CurrentState: Object;

Description

The CurrentState property returns linear regression parameters.

Example

To execute the example, the page must contain the WorkbookBox component named workbookBox (see Example of Creating the WorkbookBox Component), and also add the following code in the handler, that processes document opening event:

var getCurrentStateButt = new PP.Ui.Button({
	ParentNode: document.body, //DOM parent node
	Content: "Get Current State", //Title      
	Click: PP.Delegate(onClickGetCurrentState)     
	}); 
function onClickGetCurrentState()
	{
		 //Get panel that must contain linear regression parameters wizard
		var parametersPanel = workbookBox.getPropertyBarView().getParametersPanel();
		//Get linear regression parameters wizard
		var linearRegressionWizard = parametersPanel._LinearRegressionWizard;
		//If formula type of the selected series differs from "Linear Regression", clicking the 
		//"Get Current State" button displays a message saying that the Linear Regression parameters panel cannot be applied to the selected series
		if (!linearRegressionWizard) return alert('Non0linear regression parameters wizard cannot be applied to the selected series. \n Select another series');
		//Get CurrentState of the linear regression parameter setup wizard
		var state = linearRegressionWizard.getCurrentState();
		alert(JSON.stringify(state));
		//Output activity of the AR (autoregression) and MA (moving average) fields
		alert(linearRegressionWizard.getIsArmaEnabled());
	}

After executing the example the page will contain the WorkbookBox component and a button named Get Current State. To execute the example, select several series in the workbook. In the Calculations ribbon tab click the Regression button and select Linear Regression in drop-down menu. In the Series tab of the side panel open the Parameters panel and select any parameter, and then click the Get Current State button. A message that contains specified parameters of linear regression appears in the screen. If a type other than Linear Regression is selected, clicking this button shows the following message: Linear regression wizard cannot be applied to specified series. Select another series.

See also:

LinearRegressionEquationWizardView