JSFiddle - React, Tailwind, and code Playground
by jesperra
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
#fm-pivot-view .fm-grid-layout div.fm-header.fm-header-c {
text-align: right;
}
#fm-pivot-view .fm-grid-layout #fm-cols-filter div.fm-row {
text-align: center;
}
#fm-pivot-view .fm-grid-layout i.fm-icon.fm-v-sort-icon, #fm-pivot-view .fm-grid-layout i.fm-icon.fm-v-sort-desc, #fm-pivot-view .fm-grid-layout i.fm-icon.fm-v-sort-asc {
left: 0px;
width: 0px;
}
#fm-pivot-view .fm-grid-layout .fm-cell.fm-h-sort, #fm-pivot-view .fm-grid-layout .fm-cell.fm-v-sort {
padding-right: 4px !important;
}
JavaScript
new Flexmonster({
container: "#pivot-container",
componentFolder: "https://cdn.flexmonster.com/",
width: "100%",
height: 430,
toolbar: true,
report: {
dataSource: {
filename: "data/sales.csv"
},
slice: {
rows: [{
uniqueName: "Month"
}, {
uniqueName: "[Measures]"
}],
columns: [{
uniqueName: "Category",
levelName: "Product Name",
filter: {
members: [
"category.[condiments].[bbq sauce]",
"category.[breakfast cereals].[corn flakes]"
]
}
}],
measures: [{
"uniqueName": "Revenue",
"aggregation": "sum",
"format": "2sfou03a"
}]
},
conditions: [{
formula: "#value < 2500",
measure: "Revenue",
format: {
backgroundColor: "#df3800",
color: "#FFFFFF"
},
isTotal: false
}, {
formula: "#value > 20000",
measure: "Revenue",
format: {
backgroundColor: "#00A45A",
color: "#FFFFFF"
},
isTotal: false
}],
formats: [{
name: "2sfou03a",
thousandsSeparator: ",",
decimalSeparator: ".",
decimalPlaces: 2,
currencySymbol: "$",
currencySymbolAlign: "left",
nullValue: "",
textAlign: "right",
isPercent: false
}]
}
});