我正在尝试使用堆积的条形图来进行向下钻取。问题是,当我单击图表时,它会显示钻取明细,但显示的是我要分配的更多类别。因此,您能帮我解决问题吗?
我的代码在JSFIDDLE中可用
function setChart(name, categories, data, color, level, type) {
alert("Chart should have categories :-" + categories.length)
chart.xAxis[0].setCategories(categories);
//chart.xAxis[0].categories = categories;
var dataLen = data.length;
for (var i = 0; i < chart.series.length; i++) {
chart.series[0].remove();
}
for (var i = 0; i < dataLen; i++) {
chart.addSeries({
type: type,
name: name,
data: data[i],
level: level,
color: color || 'white'
});
}
}
您需要更新max
属性:
chart.xAxis[0].update({
categories: categories,
max: categories.length - 1
}, false);