双轴在Highstock? [英] Dual Axis in Highstock?

查看:95
本文介绍了双轴在Highstock?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有什么办法可以像Highcharts这样在Highstock中制造双轴?

http://www.highcharts.com/demo/combo-dual-axes

解决方案

看起来你可以像在highcharts中一样进行操作。每个系列指定yAxis:n其中n是您想要对其进行绘制的轴,并且您需要定义n个y轴入口。我修改了其中一个示例highstock demo: http://jsfiddle.net/ykfmG/

  $ .getJSON('http://www.highcharts.com/samples/data/jsonp.php?filename='+ name.toLowerCase( )+' -  c.json& callback =?',函数(data){

seriesOptions [i] = {
名称:name,
data:data,
yAxis:
};
}



y轴:[{
标签:{
格式化程序:函数(){
return(this.value> 0?'+':'')+ this.value +'%';
}
},
plotLines:[ {
value:0,
width:2,
color:'silver'
}]
},{opposite:true},{opposite:true}, {opposite:true}],


Is there any way to make a Dual Axis in Highstock like this one on Highcharts?

http://www.highcharts.com/demo/combo-dual-axes

解决方案

It looks like you can do it the same way as in highcharts. Each series specifies yAxis:n where n is the axis you want to plot it against, and you need to define n yAxis entries. I modified one of the example highstock demos: http://jsfiddle.net/ykfmG/

$.getJSON('http://www.highcharts.com/samples/data/jsonp.php?filename='+ name.toLowerCase() +'-c.json&callback=?',   function(data) {

        seriesOptions[i] = {
            name: name,
            data: data,
            yAxis:i
        };
}



        yAxis: [{
            labels: {
                formatter: function() {
                    return (this.value > 0 ? '+' : '') + this.value + '%';
                }
            },
            plotLines: [{
                value: 0,
                width: 2,
                color: 'silver'
            }]
        },{opposite:true},{opposite:true},{opposite:true}],

这篇关于双轴在Highstock?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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