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>
CSS
#fm-pivot-view .fm-grid-view div.fm-level-0.fm-cell,
#fm-pivot-view .fm-grid-view div.fm-level-0.fm-cell.fm-total {
background-color: #a7d6ae;
}
#fm-pivot-view .fm-grid-view div.fm-level-1.fm-cell,
#fm-pivot-view .fm-grid-view div.fm-level-1.fm-cell.fm-header,
#fm-pivot-view .fm-grid-view div.fm-level-1.fm-cell.fm-total {
background-color: #bee8c5;
}
#fm-pivot-view .fm-grid-view div.fm-level-2.fm-cell,
#fm-pivot-view .fm-grid-view div.fm-level-2.fm-cell.fm-header,
#fm-pivot-view .fm-grid-view div.fm-level-2.fm-cell.fm-total {
background-color: #e1f7e4;
}
#fm-pivot-view .fm-grid-layout .fm-grand-total {
background-color: #f5f5f5 !important;
}
#fm-pivot-view .fm-grid-layout span.fm-hierarchy-link {
color: #0d0d0d !important;
}
JavaScript
new Flexmonster({
container: "#pivot-container",
componentFolder: "https://cdn.flexmonster.com/",
width: "100%",
height: 600,
toolbar: true,
customizeCell: customizeCellFunction,
report: {
"dataSource": {
"type": "microsoft analysis services",
"proxyUrl": "https://olap.flexmonster.com:8085/FlexmonsterProxy/",
"catalog": "Adventure Works DW Standard Edition",
"cube": "Adventure Works",
"binary": true
},
"slice": {
"rows": [{
"uniqueName": "[Customer].[Country]"
},
{
"uniqueName": "[Date].[Month of Year]",
"caption": "Month",
"filter": {
"members": [
"[Date].[Month of Year].&[1]",
"[Date].[Month of Year].&[2]",
"[Date].[Month of Year].&[3]",
"[Date].[Month of Year].&[4]"
]
}
}
],
"columns": [{
"uniqueName": "[Measures]"
}],
"measures": [{
"uniqueName": "[Measures].[Internet Total Product Cost]",
"format": "-9cs4ysg4l9dqe"
},
{
"uniqueName": "[Measures].[Internet Standard Product Cost]"
},
{
"uniqueName": "[Measures].[Internet Gross Profit]"
},
{
"uniqueName": "[Measures].[Internet Average Sales Amount]",
"active": false,
"format": "-m7dk25oo2smw7"
},
{
"uniqueName": "[Measures].[Gross Profit]",
"active": false,
"format": "-1k8oq43hkyu4b"
}
],
"expands": {
expandAll: true
}
},
"options": {
"viewType": "charts",
"chart": {
"multipleMeasures": true
},
"showMemberProperties": true
},
"formats": [{
"name": "-m7dk25oo2smw7",
"decimalPlaces": 0
},
{
"name": "-1k8oq43hkyu4b",
"decimalPlaces": 0
},
{
"name": "-9cs4ysg4l9dqe",
...