Highcharts使用对数刻度渲染bug

时间:2016-02-24 09:09:28

标签: highcharts

我有一个堆积的条形图,在大屏幕上无法正确呈现:enter image description here。当它适用于正常的屏幕尺寸时,当屏幕变得非常宽时,条形图会神奇地消失:

Error: Invalid value for <text> attribute x="-Infinity"a.xSetter 
@ highcharts.js:78O.attr 
@ highcharts.js:44Va.render 
@ highcharts.js:114(anonymous function) 
@ highcharts.js:153o 
@ highcharts.js:25ka.render 
@ highcharts.js:153ka.redraw 
@ highcharts.js:155(anonymous function) 
@ highcharts.js:213o 
@ highcharts.js:25hb.redraw 
@ highcharts.js:213hb.setSize 
@ highcharts.js:224(anonymous function) 
@ highcharts.js:222setTimeout (async)Pa 
@ highcharts.js:10hb.reflow 
@ highcharts.js:222b 
@ highcharts.js:222

请注意,当非yAxis类型未设置为logarithmic时,它可以正常工作。

jsFiddle

$(function () {
    $('#container').highcharts({
        chart: {
            type: 'bar'
        },
        title: {
            text: 'Stacked bar chart'
        },

        yAxis: {
            type: 'logarithmic',
            title: {
                text: 'Total fruit consumption'
            }
        },
        legend: {
            reversed: true
        },
        plotOptions: {
            series: {
                stacking: 'normal'
            }
        },
        series: [{"data":[2,2,3,3,4,4,3,3,66,65],"name":"T1","stack":"purchases","color":"#a3f5c4","enableMouseTracking":true},{"data":[4,4,6,6,9,9,7,8,181,189],"name":"T2","stack":"offers","color":"#f5d4a3","enableMouseTracking":false},{"data":[17,7,14,19,16,14,19,23,473,460],"name":"T#","stack":"paywalled","color":"#f5a3a3","enableMouseTracking":false}]
    });
});

0 个答案:

没有答案