未捕获的TypeError:无法读取属性' emptyForce'未定义的(Jqplot)

时间:2016-02-02 15:59:13

标签: javascript jquery jqplot

在电话的方向更改事件中,我重新绘制图形:

$( window ).on( "orientationchange", function( event ) {
    $('#flot-chart-line-cumul-sales').empty();
    setTimeout(function() {                                    
        plotLineSales.replot({resetAxes:true});
    }, 200);
}

jqplot此时在 jqplot.pointLabels.min.js 文件中的控制台中启动此错误 t._elems [w] .emptyForce()< /强>:

Uncaught TypeError: Cannot read property 'emptyForce' of undefined

仅供参考:也许可以提供帮助,这是jqplot的点标签代码:

    series:[
            {
                label:'Open + Closed', 
                color:' #4BB2C5',
                pointLabels:
                {
                    show:true,
                    ypadding: 7,
                    stackedValue: false,
                    hideZeros: false,
                    formatString:'%d',
                    escapeHTML:false
                }
            },
            {   
                label:'Closed', 
                color:' #EAA228',
                pointLabels:
                {
                    show:true,
                    ypadding: -25,
                    stackedValue: false,
                    hideZeros: false,
                    formatString:'%d',
                    escapeHTML:false
                }
            },

        ],

任何人都可以帮助我吗?

1 个答案:

答案 0 :(得分:0)

这个快速修复工作。

jqplot.pointLabels.min.js 我已更改

t._elems[w].emptyForce()

if(t._elems[w]) t._elems[w].emptyForce();