繁体   English   中英

高图:yAxis标题=当前系列名称

[英]Highcharts: yAxis title = current series name

如何使yAxis标题与当前所选系列相同?

yAxis: [{
    min: 0,
    title: {
        text: 'Hits', <-- this value should be based on selected series name
    },
    labels: {
        formatter: function () {
            return this.value;
        },
        style: {
            color: '#4572A7'
        }
    }

}]

这样的事情应该起作用。 单击系列时,它将yAxis的标题设置为系列的名称。 jsfiddle在这里

plotOptions: {
    series: {
        events: {
            click: function() {
                this.chart.yAxis[0].setTitle({text: this.name});
            }
        }
    }
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM