Flexmonster - Pivot Table demo
Demos
by Sundarapandiyan_pa
HTML
<link rel="stylesheet" href="https://s3.amazonaws.com/flexmonster/2.3/demo.css">
<script src="https://cdn.flexmonster.com/flexmonster.js"></script>
<button onclick="getmeasures()">Load report</button>
<div id="pivot-container"></div>
JavaScript
var pivot = new Flexmonster({
container: "#pivot-container",
componentFolder: "https://cdn.flexmonster.com/",
width: "100%",
height: 430,
toolbar: true,
report: {"dataSource":{"type":"csv","filename":"data/sales.csv"},"slice":{"rows":[{"uniqueName":"Category","filter":{"members":["category.[condiments].[bbq sauce]","category.[breakfast cereals].[corn flakes]","category.[confectionery]","category.[bakery].[chocolate biscuits]","category.[fruit preserves].[apple jam]","category.[bakery].[apple cake]","category.[soups].[tomato soup]"]},"sort":"asc"},{"uniqueName":"Quantity","sort":"asc"},{"uniqueName":"Unit Price","sort":"asc"}],"columns":[{"uniqueName":"[Measures]"}],"measures":[{"uniqueName":"Revenue","aggregation":"sum","format":"2sfou03a"}],"flatOrder":["Category","Revenue","Quantity","Unit Price"]},"options":{"grid":{"type":"flat","showTotals":"off","showGrandTotals":"off"}},"formats":[{"name":"2sfou03a","thousandsSeparator":",","decimalSeparator":".","decimalPlaces":2,"currencySymbol":"$","positiveCurrencyFormat":"$1","nullValue":"","textAlign":"right","isPercent":false}],"version":"2.7.22","creationDate":"2020-01-02T11:45:35.499Z"}
});
function getmeasures() {
console.log(pivot.getMeasures());
pivot.getData({}, function (result) {
console.log(result);
});
}