Dual Axis in Highstock?

你说的曾经没有我的故事 提交于 2019-12-24 03:31:00

问题


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

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


回答1:


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}],


来源:https://stackoverflow.com/questions/15644258/dual-axis-in-highstock

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!