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
new Flexmonster({
container: "#pivot-container",
componentFolder: "https://cdn.flexmonster.com/",
width: "100%",
height: 550,
toolbar: true,
report: {
"dataSource": {
"type": "json",
"data": getData(),
"mapping": {
"Quantity": {
"type": "number"
},
"Price": {
"type": "number"
},
"Retail Category": {
"type": "string"
},
"Sales": {
"type": "number"
},
"Order Date": {
"type": "year/quarter/month/day"
},
"Date": {
"type": "date"
},
"Status": {
"type": "string"
},
"Product Code": {
"type": "string"
},
"Phone": {
"type": "string"
},
"Country": {
"type": "string",
"folder": "Location"
},
"City": {
"type": "string",
"folder": "Location"
},
"CurrencyID": {
"type": "property",
"hierarchy": "Country"
},
"User Name": {
"type": "string"
},
"Deal Size": {
"type": "string"
}
}
},
"slice": {
"rows": [{
"uniqueName": "User Name"
}],
"columns": [{
"uniqueName": "Order Date",
"levelName": "Order Date.Year"
},
{
"uniqueName": "[Measures]"
}
],
"measures": [{
"uniqueName": "Price",
"aggregation": "sum",
"format": "-13w0a1w1c23j00"
}],
"sorting": {
"column": {
"type": "desc",
"tuple": [],
"measure": {
"uniqueName": "Price",
"aggregation": "sum"
}
}
}
},
"formats": [{
"name": "-13w0a1w1c23j00",
"thousandsSeparator": " ",
"decimalSeparator": ".",
"decimalPlaces": 0,
"currencySymbol": "$",
...