JSFiddle - React, Tailwind, and code Playground
by Flexmonster Pivot Table
HTML
<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: {
data: getData()
},
options: {
viewType: "charts",
chart: {
type: "pie"
}
},
slice: {
rows: [{
uniqueName: "Status"
}],
measures: [{
uniqueName: "Name",
aggregation: "percentofparentrowtotal"
}]
},
formats: [{
name: "",
decimalPlaces: 2
}]
}
});
function getData() {
return [{
Status: "Satisfied",
Name: "Reno",
Code: 123581321
}, {
Status: "Not Satisfied",
Name: "Charlotte",
Code: 223581321
}, {
Status: "Satisfied",
Name: "Caroline",
Quantity: 323581321
}, {
Status: "Satisfied",
Name: "Louis",
Code: 423581321
}, {
Status: "Not Started",
Name: "Gage",
Code: 523581321
}, {
Status: "Not Started",
Name: "Noel",
Code: 623581321
}];
}