Closed ausfas closed 1 year ago
I'm trying to use fractionOf... total but its not working:
$(function () { var derivers = $.pivotUtilities.derivers; var numberFormat = $.pivotUtilities.numberFormat; var intFormat = numberFormat({ digitsAfterDecimal : 0 }); var tpl = $.pivotUtilities.aggregatorTemplates; var sum = $.pivotUtilities.aggregatorTemplates.sum; var usFmtPct = numberFormat({ digitsAfterDecimal : 1, scaler : 100, suffix : "%" }) var fractionOfTotalSum = $.pivotUtilities.aggregatorTemplates.fractionOf(sum(), 'total', usFmtPct) }; var renderers = $.extend( $.pivotUtilities.renderers, var lstaggregators = { "Total Cost" : function () { return tpl.sum()(["Total"]) }, "Sum as Fraction of Total Cost" : tpl.fractionOf(tpl.sum()(["Cost"]), "total", usFmtPct), }; var parseAndPivot = function (f) { $("#output").html("<p align='center' style='color:grey;'>(processing...)</p>") Papa.parse(f, { skipEmptyLines : true, error : function (e) { alert(e) }, complete : function (parsed) { $("#output").pivotUI(parsed.data, { aggregators : lstaggregators,
and getting error:
Uncaught TypeError: wrapped.apply(...) is not a function
I've tried replicating https://github.com/nicolaskruchten/pivottable/issues/504 but still not working Sum works fine
should be function(){return tpl.fractionOf(tpl.sum(), "total", usFmtPct)(["Cost"])} If anyone having the same issue :)
I'm trying to use fractionOf... total but its not working:
and getting error:
I've tried replicating https://github.com/nicolaskruchten/pivottable/issues/504 but still not working Sum works fine