问题描述
在下面的图表中,可以将y轴标签(非洲)移动到图表的左上方。
xAxis: {
categories: ['Africa'],title: {
text: null
}
}
https://jsfiddle.net/wanp1bqg/2/
输出如下
解决方法
您可以在render
事件中重新定位标签,例如:
events: {
render: function() {
this.xAxis[0].ticks[0].label.attr({
y: this.plotTop
});
}
}
实时演示: https://jsfiddle.net/BlackLabel/rcxg3unm/
API参考:
https://api.highcharts.com/highcharts/chart.events.render
https://api.highcharts.com/class-reference/Highcharts.SVGElement#attr