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>
CSS
:root {
--font-size: 16px;
}
#fm-pivot-view .fm-ui div {
font-size: var(--font-size) !important;
}
#fm-pivot-view .fm-grid-row {
min-height: calc(var(--font-size)*2.5) !important;
}
JavaScript
new Flexmonster({
container: "#pivot-container",
componentFolder: "https://cdn.flexmonster.com/",
width: "100%",
height: 550,
customizeCell: customizeCell,
toolbar: true,
report: {
"dataSource": {
"data": [{
"ShipDate": {
"type": "string"
},
"ProductName": {
"type": "string"
},
"Province": {
"type": "string"
},
"OrderPriority": {
"type": "string"
},
"DiscountSUM": {
"type": "number"
},
"SalesSUM": {
"type": "number"
}
}, {
"ShipDate": "2009-01-02T00:00:00.000+0530",
"ProductName": "Hon 4070 Series Pagoda� Armless Upholstered Stacking Chairs",
"Province": "British Columbia",
"OrderPriority": "Low",
"DiscountSUM": "0.0000000000",
"SalesSUM": "1239.0600000000"
}
]
},
"formats": [{
"name": "",
"thousandsSeparator": ","
}
],
"slice": {
"rows": [{
"uniqueName": "ShipDate",
"caption": "ShipDate",
"sort": "asc"
}, {
"uniqueName": "ProductName",
"caption": "ProductName",
"sort": "asc"
}, {
"uniqueName": "Province",
"caption": "Province",
"sort": "asc"
}, {
"uniqueName": "OrderPriority",
"caption": "OrderPriority",
"sort": "asc"
}
],
"columns": [],
"measures": [{
"uniqueName": "DiscountSUM",
"aggregation": "sum",
"caption": "Discount (Sum)"
},...