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/",
height: 550,
toolbar: true,
report: {
dataSource: {
type: "json",
filename: "data/retail-data.json",
},
options: {
grid: {
type: "classic"
}
},
slice: {
rows: [{
uniqueName: "Country",
}, {
uniqueName: "City"
}],
columns: [{
uniqueName: "Status",
},
{
uniqueName: "[Measures]",
},
],
expands: {
expandAll: true
},
measures: [{
uniqueName: "Price",
aggregation: "sum",
format: "currency",
}, ],
},
conditions: [{
formula: "#value > 10000",
measure: "Price",
aggregation: "sum",
format: {
backgroundColor: "#00A45A",
color: "#FFFFFF"
},
isTotal: true
}],
formats: [
{
name: "currency",
currencySymbol: "$"
}
]
},
});