答案 0 :(得分:0)
在Highcharts中没有默认选项,但是您可以计算每个标签的旋转度。此外,您需要将轴标签的align
设置为center
:
events: {
render: function() {
var ticks = this.xAxis[0].ticks,
length = this.xAxis[0].categories.length,
rotation = 360 / length / 2;
Highcharts.objectEach(ticks, function(tick) {
tick.label.attr({
rotation: rotation
});
rotation += 360 / length;
});
}
}
实时演示:http://jsfiddle.net/BlackLabel/shgj8o9t/
API:https://api.highcharts.com/highcharts/xAxis.labels.align