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,
beforetoolbarcreated: customizeToolbar,
report: {
dataSource: {
filename: "data/sales.csv"
},
"slice": {
"rows": [{
"uniqueName": "Region"
}],
"columns": [{
"uniqueName": "[Measures]"
},
{
"uniqueName": "Salesperson"
}
],
"measures": [{
"uniqueName": "Unit Price",
"aggregation": "sum"
}]
}
}
});
function customizeToolbar(toolbar) {
// get all tabs
var tabs = toolbar.getTabs();
toolbar.getTabs = function() {
//change the icon of the "Connect" Tab:
tabs[0].icon = ic;
//reposition the "Export" Tab:
reposition(tabs, 3, 0);
return tabs;
}
//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...