繁体   English   中英

Highcharts多个yaxis图带碰撞

[英]Highcharts multiple yaxis plotband collision

我一直在尝试使用带有多个y轴的角度规。 我使用偏移轴属性来避免它们之间的冲突。 但是,轴的绘图区相互冲突。 是否有将它们分开的属性或任何其他解决方法?

我的尝试:

$(function () {

    $('#container').highcharts({

        chart: {
            type: 'gauge',
            plotBackgroundColor: null,
            plotBackgroundImage: null,
            plotBorderWidth: 0,
            plotShadow: false
        },

        title: {
            text: 'Speedometer'
        },

        pane: {
            startAngle: -90,
            endAngle: 90,
            background: null
        },

        // the value axis
        yAxis:[
        {
            min: 0,
            max:100,

            minorTickInterval: 'auto',
            minorTickWidth: 1,
            minorTickLength: 10,
            minorTickPosition: 'inside',
            minorTickColor: '#666',
                  labels: {
                distance: 12,
                rotation: 'auto'
            },
            offset: -30,
            tickPixelInterval: 30,
            tickWidth: 2,
            tickPosition: 'inside',
            tickLength: 10,
            tickColor: '#666',
            labels: {
                step: 2,
                rotation: 'auto'
            },

             plotBands: [{
                from: 0,
                to: 10,
                color: '#55BF3B',
            }, {
                from: 10,
                to: 70,
                color: '#DDDF0D',
            }, {
                from: 70,
                to: 90,
                color: '#DF5353',  
            }]


        },
         {
            min: 0,
            max:100,

            minorTickInterval: 'auto',
            minorTickWidth: 1,
            minorTickLength: 10,
            minorTickPosition: 'inside',
            minorTickColor: '#666',
                  labels: {
                distance: 12,
                rotation: 'auto'
            },
            offset: 30,
            tickPixelInterval: 30,
            tickWidth: 2,
            tickPosition: 'inside',
            tickLength: 10,
            tickColor: '#666',
            labels: {
                step: 2,
                rotation: 'auto'
            },

             plotBands: [{
                from: 0,
                to: 10,
                color: 'red',
                offset:30,// green
            }, {
                from: 10,
                to: 70,
                color: 'orange' // yellow
            }, {
                from: 70,
                to: 90,
                color: 'violet' // red
            }]


        }

        ],

        series: [{
            name: 'Speed',
             data: [{
                id: 'hour',
                y: 90,
            }],
        },{
        name: 'Speed',
             data: [{
                id: 'minute',
                y: 50,
            }],
        },
        ]

    },



    // Add some life
    function (chart) {
        if (!chart.renderer.forExport) {
            setInterval(function () {

            }, 3000);
        }
    });

        $('.highcharts-axis text').click(function(){                                      alert($(this).text());  
        }); 
});

https://jsfiddle.net/n1djkxLr/8/

此问题与已知错误有关,在此处已向我们的开发人员报告: https : //github.com/highcharts/highcharts/issues/5283

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM