JSFiddle - React, Tailwind, and code Playground
by Flexmonster Pivot Table
HTML
<link rel="stylesheet" href="https://s3.amazonaws.com/flexmonster/2.3/demo.css">
<script src="https://cdn.flexmonster.com/flexmonster.js"></script>
<div id="pivot-container"></div>
JavaScript
let pivot = new Flexmonster({
container: "pivot-container",
componentFolder: "https://cdn.flexmonster.com/",
toolbar: true,
report: {
dataSource: {
data: getData(),
mapping: {
"Date1": {
type: "datetime",
caption: "Date1",
format: "yyyy-MM-dd"
},
"Date2": {
type: "datetime",
caption: "Date2"
}
}
},
slice: {
rows: [{
uniqueName: "Date1"
},
{
uniqueName: "Date2",
}
],
columns: [{
uniqueName: "[Measures]"
}],
measures: []
},
options: {
grid: {
type: "flat",
showTotals: "off",
showGrandTotals: "off"
},
dateTimePattern: "yyyy-MM-dd hh:mm:ss"
}
}
});
function getData() {
return [{
"Date1": 1667551668000,
"Date2": 1667542175000,
}, ]
}