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: {
options: {
grid: {
type: "flat",
showGrandTotals: false
}
},
dataSource: {
data: [{
"Color": {
type: "string"
},
"Country": {
type: "string",
hierarchy: "Geography",
visible: false
},
"State": {
type: "string",
hierarchy: "Geography",
parent: "Country",
visible: false
},
"City": {
type: "string",
hierarchy: "Geography",
parent: "State",
visible: false
},
"Price": {
type: "number",
visible: false
},
"Quantity": {
type: "number"
}
},
{
"Color": "green",
"Country": "Canada",
"State": "Ontario",
"City": "Toronto",
"Price": 174,
"Quantity": 22
},
{
"Color": "red",
"Country": "USA",
"State": "California",
"City": "Los Angeles",
"Price": 166,
"Quantity": 19
}
]
}
}
});