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>
<script src="https://cdn.flexmonster.com/lib/flexmonster.googlecharts.js"></script>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<div id="pivot-container"></div>
<div id="googlechart-container" style="height:250px;"></div>
JavaScript
var pivot = new Flexmonster({
container: "pivot-container",
componentFolder: "https://cdn.flexmonster.com/",
toolbar: true,
report: {
dataSource: {
data: getJSONData()
},
options: {
viewType: "grid_charts",
chart: {
type: "column",
position: "right"
}
},
slice: {
"rows": [
{
"uniqueName": "FLIGHT_DATE",
"caption": "Flight Date",
"levelName": "FLIGHT_DATE.Year"
}
],
"columns": [
{
"uniqueName": "[Measures]"
}
],
"measures": [
{
"uniqueName": "Price",
"aggregation": "sum"
}
]
}
}
});
function getJSONData() {
return [{
"FLIGHT_DATE": {
caption: "Flight Date",
type: "year/month/day"
},
"Price": {
caption: "Price",
type: "number"
}
}, {
"FLIGHT_DATE": "05/20/2016",
"Price": 1000
}, {
"FLIGHT_DATE": "06/20/2016",
"Price": 1000
}, {
"FLIGHT_DATE": "05/03/2016",
"Price": 1000
}, {
"FLIGHT_DATE": "07/25/2016",
"Price": 1000
}];
}