如何将旋转应用于Highcharts中的Drilldown Lable

时间:2015-09-03 16:02:46

标签: highcharts

请您查看this demo并告诉我如何将旋转应用于drildown中的标签?

enter image description here

我尝试添加`rotation:90,就像

一样
        series: [{
        groupPadding: 0,
        pointPadding: 0,
        borderWidth: 1,
        rotation:90,

但它没有完成这项工作

2 个答案:

答案 0 :(得分:2)

您可以捕获钻取/钻取事件并在xAxis上调用update()来旋转标签。

events:{
            drilldown: function(){
                this.xAxis[0].update({
                    labels:{
                        rotation: -90
                    }
                });
            },
            drillup: function(){
                this.xAxis[0].update({
                    labels:{
                        rotation: -45
                    }
                });
            }
        }

示例:http://jsfiddle.net/hxua2Lpk/2/

答案 1 :(得分:0)

您可以使用此

 xAxis: {
            type: 'category',
            labels: {
             rotation: -45 

        }
    },

使用旋转:您想要旋转的任何角度都会旋转轴标签