使用morris时出现js报错VM9763:10 Error: <text> attribute transform: Expected number, "matrix(NaN,NaN,
来源:互联网 发布:网易邮箱服务器域名 编辑:程序博客网 时间:2024/06/10 23:11
最近使用morris,发现老是出现js报错,
版本morris.min.js v0.5.0
VM9763:10 Error: <text> attribute transform: Expected number, "matrix(NaN,NaN,
查到原因为关闭窗口时,morris仍然调用resizeHandler方法进行画图,由于窗口已经关闭,图肯定画不出来,自然就要报错.
解决方法:
找到对应方法修改源代码
Morris.Donut.prototype.resizeHandler = function() {
if (this.el && this.el.width() > 0 && this.el.height() > 0) {
this.timeoutId = null;
this.raphael.setSize(this.el.width(), this.el.height());
return this.redraw();
}
};
我遇到的情况改写这段代码就可以解决,若还有问题可参考以下代码(未尝试)
HelloGravitycommented on Jun 16 2014
0 0
- 使用morris时出现js报错VM9763:10 Error: <text> attribute transform: Expected number, "matrix(NaN,NaN,
- js: NaN
- js NaN
- JS中Number类型的NaN值
- nan
- NaN
- NaN
- NaN
- NaN
- 日期选择控件报错 NaN
- extjs4 grid 日期出现0NaN-NaN-NaN
- iOS开发:AFNetWorking请求报错:NSDebugDescription=Number wound up as NaN around character
- "nan" error in tensorflow
- 神经网络训练时,出现NaN loss
- js nan===nan
- IE浏览器下面 使用 JS的getDate()方法获取星期几出现Nan问题的解决办法
- js Number对象:属性MAX_VALUE、MIN_VALUE、NaN、NEGATIVE_INFINITY、POSITIVE_INFINITY
- js判断NaN
- JavaScript实现拖拽预览,AJAX小文件上传
- Ubuntu14.04安装mysql5.7
- Ios 应用架构详解
- 解决Eclipse导入V7包后报的各种错误
- Node.Js util模块
- 使用morris时出现js报错VM9763:10 Error: <text> attribute transform: Expected number, "matrix(NaN,NaN,
- Giraph 运行常见错误
- [QT笔记]用图片自定义QCheckBox样式
- Spark:Spark 编程模型及快速入门
- 大数据相关岗位需了解信息
- iDface,Face++,身份鉴别
- HTML新特性之WebSocket
- SharePoint Discuss Board讨论版
- Android消息机制概述 Handler
Thank you for your solution heyGalen !
I am having the same error :
Error: Invalid value for attribute transform="matrix(NaN,NaN,NaN,NaN,0,0)"
And I am also not familiar with the source code of Morris.
Although your solution did not work for me, I changed it a little, and now everything works for me, thanks.
BTW, morris.js is awesome :)
Hello there, for me the error was elsewhere, as part of the "setLabels" handler. The fix was to handle the case where "text1" or "text2" were NaN: