如題第一層的highcharts圖表為柱狀圖(也可為其他),點擊後下鑽,下鑽出來的圖形需為堆疊柱狀圖(一維的柱狀圖圖表,自己已實現,需要多維的堆疊柱狀圖)。
$(function () {
var chart;
$(document).ready(function() {
chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
type: 'column',
events:{
drilldown: function (e) {
if (!e.seriesOptions) {
var data = {
series: [{
stacking: 'normal',
type: 'column',
name: 'MSIE versions 2000',
data: [10, 7, 33, 2]
},{
stacking: 'normal',
type: 'column',
name: 'MSIE versions 2010',
data: [1, 5, 10, 15]
}]
};
chart.showLoading("加載中 ...");
setTimeout(function () {
chart.hideLoading();
chart.addSeriesAsDrilldown(e.point, data.series[0]);
//只能設置一條,直接設置data.series就不行了。
//chart.addSeriesAsDrilldown(e.point, data.series);
}, 1000);
}
}
}
},
title: {
text: '測試統計'
},
xAxis: {
type:'category'
},
yAxis: {
title: {
text: '數量'
}
},
credits:{//版權連接
enabled:false
},
series: [{name: '浏覽器',data: [{
y: 55,
drilldown: true
}]},{name: '浏覽器12',data: [{
y: 35,
drilldown: false
}]}
]
});
});
});