updateCalculatedRow (wbk: PP.TS.WbkDocument, metaData: PP.Mb.Ui.PropertyChangedEventArgs, getStatistics: Boolean, callback: PP.Delegate);
wbk. Workbook document.
metaData. Workbook metadata that contain information on calculated series to be changed. Parameter value is specified as an object.
getStatistics. Indicates whether to get statistic data for the series. If the parameter is set to True statistic data is received, if parameter value is False, data is not received
callback. Callback function for getting response from workbook service.
The updateCalculatedRow method refreshes calculated time series in the workbook.
The Metadata field of the metaData parameter that is an object of the PP.Mb.Ui.PropertyChangedEventArgs type, must contain a JSON object with the following properties:
DependentSeries. Array of dependent series.
FormulaType. Type of formula applied on series calculation (it is set by means of the PP.TS.Ui.FormulaTypeEnum enumeration).
SelectionTimeRanges. Array of selected time ranges.
Splice. Series splice setup object containing properties:
Direction. Series splice direction determined by means of element of the PP.TS.Ui.TsSpliceDirection enumeration.
Type. Series splice series determined by means of the PP.TS.Ui.TsSpliceType enumeration.
SpliceMethod. Parameter that is similar to Splice.
To execute the example, the HTML page must contain the WorkbookBox component named workbookBox (see Example of Creating the WorkbookBox Component). Set method and direction of time series splicing in an appropriate wizard in the Parameters tab of the workbook side panel:
// Get workbook data source var source = workbookBox.getSource(); // Get service for working with workbook var service = tsService; // Get workbook properties panel var propertyBar = workbookBox.getPropertyBarView(); // Get parameters panel var parametersPanel = propertyBar.getParametersPanel(); // Display this panel parametersPanel.show(); // Expand panel parametersPanel.expand(); // Get time series splice setup wizard var spliceMethodWizard = parametersPanel.getSpliceMethodWizard(); // Display this wizard spliceMethodWizard.show(); // Get wizard settings var metadata = spliceMethodWizard.getCurrentState(); // Specify operation type metadata.formulaType = PP.TS.Ui.FormulaTypeEnum.ConversionsJoinSeries; // Specify selected series metadata.selectedRows = source.getSelectedSeries(); // Set series splice method and direction metadata.spliceMethod = { direction: PP.TS.Ui.TsSpliceDirection.Backward, type: PP.TS.Ui.TsSpliceType.Pch }; // Determine callback function arguments var args = new PP.Mb.Ui.PropertyChangedEventArgs({ PropertyName: PP.TS.Ui.PropertyGroups.Parameters, Metadata: metadata, TypeUpdateData: [PP.TS.Ui.ViewTypeUpdate.UpdateCalculateSeries, PP.TS.Ui.ViewTypeUpdate.Chart, PP.TS.Ui.ViewTypeUpdate.Map, PP.TS.Ui.ViewTypeUpdate.StatPanel] }); // Determine callback function var onResponse = function (sender, args) { // Refresh parameters panel parametersPanel.refresh(); }; // Refresh calculated time series in workbook according to specified settings service.updateCalculatedRow(source, args, true, PP.Delegate(this.onResponse, this, args));
After executing the example the method of series splicing with inverse growth rates is selected in the time series splicing wizard:
See also: