what is the correct way to add or upgrade existing operation (sum,
max, min, count)
I want to display dates in the value field
is this possible?
from already thank you very much
Hello,
You can add any custom operation to pivot ‘operations’ collection as well as redefine any existing one in the following way:
webix.ready(function(){
var pivot = webix.ui({
view:"pivot",
structure:{
values:[
{ name:"gdp", operation:"abssum"}
]
}
});
pivot.operations.abssum = function(data) {
//data - array of values which need to be processed
var sum = 0;
for (var i = 0; i < data.length; i++) {
var num = window.parseFloat(data[i], 10);
if (!window.isNaN(num))
sum += Math.abs(num);
}
return sum;
};
})
Here it’s described in the documentation: http://docs.webix.com/desktop__pivot.html#configuringpivot
As to dates, now there’s no possibility to display them in the value field.
thank you very much for the information.!