高图表定制中的Yaxis值 [英] Yaxis Values on High Chart Customization

查看:62
本文介绍了高图表定制中的Yaxis值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试按照我的定义在我的海图上填充yaxis值,应该相应地显示结果,但是我的所有努力都是徒劳的,因为我无法手动设置highchart的yaxis this.value.以下是我的Jsfiddle的链接.请帮助.

I have been trying to populate yaxis values on my highchart as per defined by me and results should be shown accordingly but all my efforts are in vain i am not able to manually set this.value of yaxis of highchart . Following is a link to my Jsfiddle . Kindly help..

http://jsfiddle.net/CzHyC/12/

在下面的JS代码中,我试图将yaxis的this.value设置为yAxisLabels的数组值,但是未对值进行标注并且未相应地布置图表.

In the following JS COde I have been trying to set the this.value of yaxis to the arrayed values of yAxisLabels but values are not being labled and chart is not dislayed accordingly.

YAXIS的JS代码

var yAxisLabels = ['5','10','20','30','40','50'];


yAxis: {
    labels: {
        formatter: function () {
            for (i=0; i<=5; i++) {
                this.value=yAxisLabels[i];
                return this.value;
            }
        }
    },

    title: {
        text: 'Total fruit consumption'
    },
    stackLabels: {
        enabled: true,
        style: {
            fontWeight: 'bold',
            color: (Highcharts.theme && Highcharts.theme.textColor) || 'blue'
        }
    }
}

推荐答案

您也可以这样设置

tickPositions: [0, 5, 10, 20, 30, 40, 50],

这篇关于高图表定制中的Yaxis值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆