JSFiddle - React, Tailwind, and code Playground
by amirsamad
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="pivotContainer"></div>
JavaScript
var pivot = new Flexmonster({
container: "pivotContainer",
componentFolder: "https://cdn.flexmonster.com/",
toolbar: true,
report: {
"dataSource": {
data: getData()
},
"slice": {
"rows": [{
"uniqueName": "Country"
},
{
"uniqueName": "Department"
}
],
"columns": [{
"uniqueName": "[Measures]"
}],
"measures": [{
"uniqueName": "Employee number",
"aggregation": "average",
"format": "rounding"
}]
},
"options": {
"viewType": "charts",
"chart": {
"type": "line",
"showDataLabels": true,
"position": "right"
}
},
"formats": [{
"name": "rounding",
"decimalPlaces": 0
}],
}
});
function getData() {
return [{
"Country": "USA1",
"Department": "Belva",
"Employee number": 1
}
]
}