Define the "time" type using the mapping
Mapping configuration
by Flexmonster Pivot Table
HTML
<script src="https://cdn.flexmonster.com/flexmonster.js"></script>
<div id="pivot-container"></div>
CSS
@import url(https://cdn.flexmonster.com/assets/jsfiddle-styles.css);
JavaScript
let pivot = new Flexmonster({
container: "pivot-container",
componentFolder: "https://cdn.flexmonster.com/",
toolbar: true,
report: {
dataSource: {
data: getData(),
mapping: {
"Duration": {
type: "time",
format: "d'd' HH'h' mm'min'"
}
}
},
slice: {
rows: [ { uniqueName: "Event" } ],
columns: [ { uniqueName: "[Measures]" } ],
measures: [ { uniqueName: "Duration" } ]
}
}
});
function getData() {
return [{
"Event": "Concert",
"Duration": 451515
},
{
"Event": "Performance",
"Duration": 2626
},
{
"Event": "Cinema",
"Duration": 152424
}
]
}