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="pivotContainer"></div>
JavaScript
var pivot = new Flexmonster({
container: "pivotContainer",
componentFolder: "https://cdn.flexmonster.com/",
toolbar: true,
report: {
"dataSource": {
"type": "json",
"data": getData(),
"mapping": {
"onboardingDate": {
"caption": "OnboardingDate",
"type": "date string"
},
"lastModifiedDate": {
"caption": "LastModifiedDate",
"type": "date string"
},
"users": {
"caption": "Users",
"type": "object"
}
}
},
"slice": {
"rows": [{
"uniqueName": "users"
}],
"measures": [{
"uniqueName": "onboardingDate",
"aggregation": "max"
},
{
"uniqueName": "lastModifiedDate",
"aggregation": "max"
}
],
"flatOrder": [
"onboardingDate",
"lastModifiedDate",
"users"
]
},
"options": {
"grid": {
"type": "flat",
"grandTotalsPosition": "bottom"
}
}
}
});
function getData() {
return [{
"onboardingDate": "2020-08-27T07:28:14.072Z",
"lastModifiedDate": "2020-08-27T07:28:18.965Z",
"users": [
"test user"
]
},
{
"onboardingDate": "2020-08-27T07:27:31.936Z",
"lastModifiedDate": "2020-08-27T07:27:36.853Z",
"users": [
"test user"
]
},
{
"onboardingDate": "2020-08-17T06:23:07.937Z",
"lastModifiedDate": "2020-08-17T06:23:27.181Z",
"users": [
"test user"
]
},
{
"onboardingDate": "2020-08-17T04:18:06.397Z",
"lastModifiedDate": "2020-08-17T04:18:20.877Z",
"users": [
"test user"
]
},
{
"onboardingDate": "2020-08-14T11:32:55.638Z",
"lastModifiedDate": "2020-08-14T11:33:08.859Z",
"users": [
"test user"
]
}
]
}