Highstock的双轴?

时间:2013-03-26 18:03:17

标签: highcharts highstock

有没有办法像Highcharts中那样在Highstock制作双轴?

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

1 个答案:

答案 0 :(得分:3)

看起来你可以像在highcharts中那样做。每个系列都指定yAxis:n,其中n是您要对其绘制的轴,您需要定义n个yAxis条目。我修改了一个示例highstock演示: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}],