首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Highcharts多系列和多轴类型重叠

Highcharts多系列和多轴类型重叠
EN

Stack Overflow用户
提问于 2013-12-05 19:00:26
回答 1查看 2.5K关注 0票数 1

我有一个关于多个轴重叠的highcharts图的问题。系列有两种类型,一种类型的列和一种类型的行。我希望线型始终高于其他线型,并且永远不会与它们相交。

你可以在这里看到我的问题:http://jsfiddle.net/99tC7/

期待着感谢您提供的任何帮助。

代码语言:javascript
运行
复制
$('#container').highcharts({
        title: {
            text: 'Title',
            x: -20 //center
        },
        xAxis: {
            categories: [ "5.11.13", "6.11.13", "7.11.13", "8.11.13", "9.11.13"],
            labels: {
                rotation: 270
            }
        },
        yAxis: [{
            plotLines: [{
                value: 0,
                width: 1,
                color: '#808080'
            }],
            title:{
                text: "Number 1"
            },
        },
        {
            plotLines: [{
                value: 0,
                width: 1,
                color: '#808080'
            }],
            title:{
                text: "Number 2"
            },
            opposite: true,
            max:50,
            minPadding:5,
        }],
        legend: {
            layout: 'horizontal',
            align: 'center',
            verticalAlign: 'bottom',
            borderWidth: 0
        },
        tooltip: {
            enabled: false
        },
        plotOptions: {
            line: {
                dataLabels: {
                    enabled: true,
                    formatter: function() {
                            return this.y +'%';
                    }
                }
            },
            column: {                    
                dataLabels: {
                    enabled: true,
                    formatter: function() {
                            return this.y;
                    }
                }
            }
        },
        series: [{
            name: 'L1',
            type: 'column',
            color: '#FF0000',
            yAxis: 0,
            data: [1, 5, 9, 10, 12]
            },
            {
            name: 'L2',
            type: 'column',
            color: '#00FF00',
            yAxis: 0,
            data: [16, 16, 106, 12, 11]
            },
            {
            name: 'L3',
            yAxis: 1,
            data: [38, 24, 37, 29, 37]
            }
        ]
    });
EN

Stack Overflow用户

发布于 2013-12-05 19:42:35

您可以尝试在两个yAxis中设置正确的min/max值,如下所示的http://jsfiddle.net/99tC7/1/

票数 1
EN
查看全部 1 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/20398198

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档