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://code.jquery.com/jquery-2.2.4.min.js"></script>
<script src="https://s3.amazonaws.com/flexmonster/2.3/flexmonster.js"></script>
<div id="pivot-container"></div>
CSS
.fm-charts-msg {
display: none !important;
}
JavaScript
var pivot = $("#pivot-container").flexmonster({
componentFolder: "https://s3.amazonaws.com/flexmonster/2.3/",
width: "100%",
height: 430,
toolbar: true,
report: {
dataSource: {
dataSourceType: "csv",
filename: "https://cdn.flexmonster.com/2.3/data/data.csv"
},
slice: {
columns: [{
uniqueName: "Color"
}],
rows: [{
uniqueName: "Country"
}, {
uniqueName: "[Measures]"
}],
measures: [{
uniqueName: "Price",
format: "currency"
}, {
uniqueName: "Discount",
format: "currency"
}],
},
formats: [{
name: "currency",
currencySymbol: "$",
currencySymbolAlign: "left",
thousandsSeparator: ",",
decimalPlaces: 2
}],
conditions: [{
formula: "if(#value < 2000, 'trueStyle')",
measure: "Discount",
trueStyle: {
backgroundColor: "#CCFFCC",
}
}, {
formula: "if(AND(#value > 2000, #value < 4000), 'trueStyle')",
measure: "Discount",
trueStyle: {
backgroundColor: "#FFFF99",
}
}],
"options": {
"viewType": "charts",
"grid": {
"type": "compact",
"title": "",
"showFilter": true,
"showHeaders": true,
"fitGridlines": false,
"showTotals": true,
"showGrandTotals": "on",
"showExtraTotalLabels": false,
"showHierarchies": true,
"showHierarchyCaptions": true,
"showReportFiltersArea": true,
"pagesFilterLayout": "horizontal"
},
"chart": {
"type": "bar",
"title": "",
"showFilter": true,
"labelsHierarchy": "",
"multipleMeasures": false,
"oneLevel": false,
"autoRange": false,
...