Hide or show aggregation labels
Options
by Flexmonster Pivot Table
HTML
<script src="https://cdn.flexmonster.com/flexmonster.js"></script>
<button onclick="showAggregationLabels()">Show aggregation labels</button>
<button onclick="hideAggregationLabels()">Hide aggregation labels</button>
<div id="pivot-container"></div>
CSS
@import url(https://cdn.flexmonster.com/assets/jsfiddle-styles.css);
JavaScript
let pivot = new Flexmonster({
container: "pivot-container",
componentFolder: "https://cdn.flexmonster.com/",
toolbar: true,
report: {
dataSource: {
filename: "data/data.csv"
},
options: {
showAggregationLabels: false
},
slice: {
columns: [],
rows: [{
uniqueName: "Country"
}],
measures: [{
uniqueName: "Price"
}, {
uniqueName: "Quantity"
}],
}
}
});
function showAggregationLabels() {
pivot.setOptions({
showAggregationLabels: true
});
pivot.refresh();
}
function hideAggregationLabels() {
pivot.setOptions({
showAggregationLabels: false
});
pivot.refresh();
}