JSFiddle - React, Tailwind, and code Playground
by Flexmonster Pivot Table
HTML
<script src="https://cdn.flexmonster.com/flexmonster.js"></script>
<button onclick="refreshGrid()">
Refresh Grid
</button>
<div id="boaContainerEng"></div>
CSS
#fm-pivot-view .fm-grid-view div.fm-cell.alter {
color:#ff0000;
}
.fm-header {
white-space: normal !important;
}
JavaScript
/* var isLocal = window.location.href.includes('localhost') || window.location.href.includes('127.0.0.1')
var URL = isLocal ? "http://localhost:51718/api" : "https://boapivot.azurewebsites.net/api" */
var boa_report_eng = {
"dataSource": {
Type: "api",
index: "fm-product-sales",
url: "https://olap.flexmonster.com:9500"
},
"options": {
showAggregationLabels: "false",
grid: {
type: "flat",
showTotals: "false",
showGrandTotals: "false",
grandTotalsPosition: "bottom"
},
defaultDateType: "date string",
datePattern: "yyyy-MM-dd"
},
"tableSizes": {
columns: [{
idx: 0,
width: 5
},
{
idx: 1,
width: 65
},
{
idx: 2,
width: 68
},
{
idx: 3,
width: 75
},
{
idx: 4,
width: 85
},
{
idx: 5,
width: 75
},
{
idx: 6,
width: 85
},
{
idx: 7,
width: 85
}
],
rows: [{
idx: 0,
height: 50
}]
},
slice: {
"rows": [{
"uniqueName": "Category"
},
{
"uniqueName": "Size"
},
{
"uniqueName": "Color"
},
{
"uniqueName": "Destination"
},
{
"uniqueName": "Business Type"
},
{
"uniqueName": "Country"
}
],
"columns": [{
"uniqueName": "[Measures]"
}],
"measures": [{
"uniqueName": "Price",
"aggregation": "sum"
},
{
"uniqueName": "Quantity",
"aggregation": "sum"
},
{
"uniqueName": "Discount",
"aggregation": "sum"
}
],
"expands": {
"expandAll": "true"
},
"flatOrder": [
"Category",
"Size",
"Color",
"Destination",
"Business Type",
"Country",
"Price",
"Quantity",
"Discount"
]
},
formats: [{
"name":...