setPareto(report: PP.Exp.EaxDocument, metadata: Object, callback: PP.Delegate);
report. Express report document.
metadata. Pareto distribution settings shown as a JSON object with columnsSettings and rowsSettings nested properties. The following fields can be available in each of these properties: displayMax - indication of maximum displaying, elementIndex - element index, enabled - indication of element availability, kind - type of Pareto distribution (this value is set with the PP.Exp.Ui.PvtParetoKind enumeration), threshold - value for specified type of distribution.
callback. Callback function.
The setPareto method sets Pareto distribution in express report.
Executing the example requires that the HTML page contains the ExpressBox component named expressBox (see Example of Creating the ExpressBox Component) and have a loaded table in express report working area. Distribute data in the table column with the index 2, using the Top 20% principle:
// Get a servcie used to work with express report var eaxMdService = expressBox.getService(); // Get express report document var eaxAnalyzer = expressBox.getSource(); // Determine row and column settings var metadata = { pivot: { pareto: { columnsSettings: { displayMax: False, elementIndex: "2", // Element index enabled: True, kind: "Percent", // The Top 20% distribution threshold: "0.2" }, rowsSettings: { enabled: False } } } }; // Determine arguments for callback function var args = new PP.Mb.Ui.PropertyChangedEventArgs({ PropertyName: PP.Exp.Ui.RibbonTableEnum.TablePareto, Metadata: metadata, TypeUpdateData: PP.Exp.Ui.ViewTypeUpdate.DataView }); // Determine callback function var onPanelChanged = function (n, t) { var chartView = expressBox.getDataView().getChartView(); t ? (chartView.DataChanged.fire(chartView, t.Args), t.Args.fireCallback(n, t)) : chartView.DataChanged.fire(chartView, t); }; // Set a new type of element distribution eaxMbService.setPareto(eaxAnalyzer, metadata, PP.Delegate(this.onPanelChanged, eaxMdService, args)); // Refresh express report expressBox.refreshAll();
After executing the example data in the table column with the index 2 is distributed using the Top 20% principle:
See also: