adds a custom operation
name | string | the name of the new operation |
label | string | the label of the new operation |
function | function | the function that will be called for cells assigned to this operation |
myPivot.addMathMethod("avr", "Avr", (cellData) => {
const sum = cellData.reduce((el, all) => all += el);
return (sum / cellData.length).toFixed(3);
});
Related sample: Custom methods