CurrentState: Object;
The CurrentState property returns linear regression parameters.
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 non-linear regression parameters wizard var parametersPanel = workbookBox.getPropertyBarView().getParametersPanel(); console.log(parametersPanel); //Get non-linear regression parameters wizard var nonLinearRegressionWizard = parametersPanel._NonLinearRegressionWizard; //If formula type of the selected series differs from "Non-Linear Regression", clicking the //"Get Current State" button displays a message saying that the Non-Linear Regression parameters panel cannot be applied to the selected series if (!nonLinearRegressionWizard) return alert('Non-linear regression parameters wizard cannot be applied to the selected series. \n Select another series'); //Get CurrentState of the non-linear regression parameter setup wizard var state = nonLinearRegressionWizard.getCurrentState(); alert(JSON.stringify(state)); }
After executing the example the page will contain the WorkbookBox component and a button named Get Current State. Click the Non-linear Regression button on the Calculations ribbon tab. Click the OK button in the Calculation Parameters dialog box that opens. Open the Parameters panel in the Series tab of the side panel, select any of the available parameters and click the Get Current State button. A message containing specified parameters of non-linear regression appears in the screen. If a formula type other than Non-linear Regression is selected, clicking this button shows the following message: Non-linear regression parameters wizard cannot be applied to the selected series. Select another series.
See also: