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>
JavaScript
var pivot = new Flexmonster({
container: "pivot-container",
componentFolder: "https://cdn.flexmonster.com/",
toolbar: true,
report: {
dataSource: {
filename: "data/sales.csv"
},
"slice": {
"rows": [{
"uniqueName": "Region"
}],
"columns": [{
"uniqueName": "[Measures]"
},
{
"uniqueName": "Salesperson"
}
],
"measures": [{
"uniqueName": "Unit Price",
"aggregation": "sum"
}]
}
}
});
pivot.on("cellclick", changeIcon);
function changeIcon(){
//custom svg icon:
var ic = "<svg xmlns=\"http://www.w3.org/2000/svg\" x=\"0px\" y=\"0px\"width=\"42\" height=\"42\"viewBox=\"-10 0 190 210\"><g transform=\"\"><g fill=\"none\" fill-rule=\"nonzero\" stroke=\"none\" stroke-width=\"1\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\" stroke-miterlimit=\"10\" stroke-dasharray=\"\" stroke-dashoffset=\"0\" font-family=\"none\" font-weight=\"none\" font-size=\"none\" text-anchor=\"none\" style=\"mix-blend-mode: normal\"><path d=\"M0,172v-172h172v172z\" fill=\"none\"></path><path d=\"\" fill=\"none\"></path><g class=\"fill-border\"><path d=\"M30.96,13.76c-9.45834,0 -17.2,7.74166 -17.2,17.2v110.08c0,9.45834 7.74166,17.2 17.2,17.2h110.08c9.45834,0 17.2,-7.74166 17.2,-17.2v-110.08c0,-9.45834 -7.74166,-17.2 -17.2,-17.2zM30.96,20.64h110.08c5.73958,0 10.32,4.58042 10.32,10.32v110.08c0,5.73958 -4.58042,10.32 -10.32,10.32h-110.08c-5.73958,0 -10.32,-4.58042 -10.32,-10.32v-110.08c0,-5.73958 4.58042,-10.32 10.32,-10.32zM127.2464,65.31297c-0.90737,0.02145 -1.76951,0.4006 -2.39859,1.05485l-38.84781,38.84781l-38.84781,-38.84781c-0.64765,-0.66575 -1.53698,-1.04135 -2.46578,-1.04141c-1.39982,0.00037 -2.65984,0.84884 -3.18658,2.14577c-0.52674,1.29693 -0.21516,2.7837 0.78799,3.76001l43.71219,43.71219l43.71219,-43.71219c1.02251,-0.98325 1.33669,-2.4933 0.79119,-3.80279c-0.5455,-1.30949 -1.83881,-2.1499 -3.25697,-2.11643z\"></path></g><path d=\"\"...