我在JSFiddle中有一个带有以下链接的图表:
https://jsfiddle.net/aditya14641/hLtj3wqb/286/
stackLabels: {
enabled: true,
formatter: function() {
var sum = 0;
var series = this.axis.series;
for (var i in series) {
sum += Math.abs(series[i].yData[this.x]);
}
if (sum < 0 && this.isNegative || sum >= 0 && !this.isNegative)
return sum;
}
}
我看到,除非调整JSFiddle窗口的大小,否则在条形图的向下钻取中显示的堆栈标签是不可见的。另外,标签显示的位置不正确:
答案 0 :(得分:0)
这似乎是错误。我在这里报告过:https://github.com/highcharts/highcharts/issues/8501
解决方法:
将setCategories
的第二个参数(重画)设置为false
:
chart.xAxis[0].setCategories(['20-30', '31-40', '41-50', '51-60']);