react-pivottable icon indicating copy to clipboard operation
react-pivottable copied to clipboard

Custom Aggregators

Open farhanabdmusa opened this issue 1 year ago • 0 comments

Hi, can i get little to create custom aggregators?

I have js code for aggregators and now i want to use it on NextJS

this is the example of my code

var tpl = $.pivotUtilities.aggregatorTemplates;
var fmtKg = $.pivotUtilities.numberFormat({suffix: ""});

$("#output").pivotUI(data, {
  renderers: renderers,
  cols: ["Country", "Month"],
  rows: ["Year", ],
  rowOrder: "key_a_to_z",
  colOrder: "key_a_to_z",
  aggregators: {
    "Net Weight (KG)": function () {
      return tpl.sum(fmtKg)(["netweight"]);
    },
  },
  rendererName: "Table",
});

Thank you

farhanabdmusa avatar Feb 16 '24 09:02 farhanabdmusa