Bar chart: withDrilldown option
Integration with Highcharts
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.highcharts.js"></script>
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/drilldown.js"></script>
<table cellpadding="10">
<tr>
<td>
<div id="pivot-container"></div>
</td>
</tr>
<tr>
<td>
<div id="highcharts-container" style="width: 100%; height: 300px; display: inline-block;"></div>
</td>
</tr>
</table>
CSS
table {
width: 100%;
border-collapse: collapse;
}
JavaScript
var pivot = new Flexmonster({
container: "#pivot-container",
componentFolder: "https://cdn.flexmonster.com/",
licenseFilePath: "https://cdn.flexmonster.com/jsfiddle.charts.key",
report: {
dataSource: {
filename: "https://www.flexmonster.com/fm_uploads/2020/06/data-highcharts.json"
},
slice: {
rows: [{
uniqueName: "Region"
}],
columns: [{
uniqueName: "[Measures]"
}],
measures: [{
uniqueName: "Quantity"
}, {
uniqueName: "Price"
}, {
uniqueName: "Discount"
}],
},
options: {
viewType: "grid",
configuratorActive: false,
grid: {
type: "compact",
showHeaders: false
}
}
},
height: 280,
toolbar: true,
beforetoolbarcreated: customizeToolbar,
reportcomplete: function() {
pivot.off("reportcomplete");
createBar();
}
});
function customizeToolbar(toolbar) {
var tabs = toolbar.getTabs();
toolbar.getTabs = function() {
tabs[6].menu.splice(5, 2)
tabs[6].menu[0].handler = createColumn;
tabs[6].menu[1].handler = createBar;
tabs[6].menu[2].handler = createLine;
tabs[6].menu[3].handler = createScatter;
tabs[6].menu[4].handler = createPie;
return tabs;
}
}
function createColumn() {
pivot.highcharts.getData({
type: "column",
},
createAndUpdateChart,
createAndUpdateChart
);
}
function createBar() {
pivot.highcharts.getData({
type: "bar",
},
createAndUpdateChart,
createAndUpdateChart
);
}
function createLine() {
pivot.highcharts.getData({
type: "line",
},
createAndUpdateChart,
createAndUpdateChart
);
}
function createScatter() {
pivot.highcharts.getData({
type: "scatter",
},
createAndUpdateChart,
createAndUpdateChart
);
}
function createPie() {
pivot.highcharts.getData({
type: "pie",
},
createAndUpdateChart,
createAndUpdateChart
);
}
function...