JSFiddle - React, Tailwind, and code Playground
by Flexmonster Pivot Table
HTML
<script src="https://cdn.flexmonster.com/flexmonster.js"></script>
<div id="pivot-container"></div>
JavaScript
var pivot = new Flexmonster({
container: "pivot-container",
componentFolder: "https://cdn.flexmonster.com/",
toolbar: true,
reportcomplete: function () {
flexmonster.off("reportcomplete");
setReport();
},
reportchange: function() {
trackChanges();
}
});
function trackChanges() {
console.log(">> reportchange", pivot.getReport());
}
var report = {
"dataSource": {
"dataSourceType": "csv",
"filename": "https://cdn.flexmonster.com/data/data.csv"
},
"slice": {
"reportFilters": [
{
"uniqueName": "Business Type",
"filter": {
"members": [
"business type.[specialty bike shop]"
]
}
}
],
"rows": [
{
"uniqueName": "Destination"
},
{
"uniqueName": "Color"
}
],
"columns": [
{
"uniqueName": "Category"
},
{
"uniqueName": "[Measures]"
}
],
"measures": [
{
"uniqueName": "Price",
"aggregation": "sum",
"format": "358eploq"
}
],
"expands": {
"rows": [
{
"tuple": [
"destination.[france]"
]
},
{
"tuple": [
"destination.[australia]"
]
}
]
}
},
"conditions": [
{
"formula": "#value < 4000",
"format": {
"backgroundColor": "#FFFFFF",
"color": "#8BC34A",
"fontFamily": "Arial",
"fontSize": "12px"
}
}
],
"formats": [
{
"name":...