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/",
report: {
dataSource: {
data: getData()
},
slice: {
rows: [
{
uniqueName: "Category"
}
],
columns: [
{
uniqueName: "[Measures]"
},
{
uniqueName: "Month"
}
],
measures: [
{
uniqueName: "Revenue",
aggregation: "count"
}
]
},
options: {
caseSensitiveMembers: true
}
}
});
function getData(){
return [
{
"Month": "",
"Category": "",
"Revenue": 708785.00
},
{
"Month": "January",
"Category": "Condiments",
"Revenue": 5737.50
},
{
"Month": "January",
"Category": "Breakfast Cereals",
"Revenue": 2370.00
},
{
"Month": "January",
"Category": "Breakfast Cereals",
"Revenue": 1580.00
},
{
"Month": "January",
"Category": "Confectionery",
"Revenue": 708785.00
},
{
"Month": "January",
"Category": "Confectionery",
"Revenue": 4477.50
},
{
"Month": "January",
"Category": "Soups",
"Revenue": 1080.00
},
{
"Month": "January",
"Category": "BAKERY",
"Revenue": 2625.00
},
{
"Month": "January",
"Category": "Bakery",
"Revenue": 1312.50
},
{
"Month": "January",
"Category": "Fruit Preserves",
"Revenue": 2962.50
}
];
}