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

时间:2022-02-13 20:09:37

On orientation change event of phone i replot the graphic:

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

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

jqplot launch this error in console in the file jqplot.pointLabels.min.js at this point t._elems[w].emptyForce():

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

Uncaught TypeError: Cannot read property 'emptyForce' of undefined

FYI: maybe can help, this is the point label code of jqplot:

仅供参考:也许可以提供帮助,这是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
                }
            },

        ],

anyone can help me?

有人可以帮帮我吗?

1 个解决方案

#1


0  

This quick fix work.

这个快速修复工作。

In jqplot.pointLabels.min.js i have changed

在jqplot.pointLabels.min.js我已经改变了

t._elems[w].emptyForce()

with

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

#1


0  

This quick fix work.

这个快速修复工作。

In jqplot.pointLabels.min.js i have changed

在jqplot.pointLabels.min.js我已经改变了

t._elems[w].emptyForce()

with

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