Incubator-echarts: Uncaught TypeError: Cannot read property '__animators' of undefined

Created on 9 Oct 2015  ·  10Comments  ·  Source: apache/incubator-echarts

这个动画错误,现象:
作图成功,但很快闪断,只剩部分图例,其余是空白

Error: e is undefined
V.prototype.stopAnimation@http://localhost:8080/assets/bower_components/echarts/build/dist/echarts-all.js:3:1
V/h.delFromMap@http://localhost:8080/assets/bower_components/echarts/build/dist/echarts-all.js:1:30324
o.prototype.delRoot@http://localhost:8080/assets/bower_components/echarts/build/dist/echarts-all.js:8:20547
o.prototype.delRoot@http://localhost:8080/assets/bower_components/echarts/build/dist/echarts-all.js:8:20438
V.prototype.delElement@http://localhost:8080/assets/bower_components/echarts/build/dist/echarts-all.js:1:30952
V.prototype.delShape@http://localhost:8080/assets/bower_components/echarts/build/dist/echarts-all.js:1:30579
t.prototype.clear@http://localhost:8080/assets/bower_components/echarts/build/dist/echarts-all.js:12:10633
t.prototype.dispose@http://localhost:8080/assets/bower_components/echarts/build/dist/echarts-all.js:12:10747
i.prototype._disposeChartList@http://localhost:8080/assets/bower_components/echarts/build/dist/echarts-all.js:1:11912
i.prototype.clear@http://localhost:8080/assets/bower_components/echarts/build/dist/echarts-all.js:1:20974
i.prototype.dispose@http://localhost:8080/assets/bower_components/echarts/build/dist/echarts-all.js:1:21279
s.init@http://localhost:8080/assets/bower_components/echarts/build/dist/echarts-all.js:1:2629
ChartsEcharts</draw_hotel_order_fail_echart@http://localhost:8080/assets/admin/pages/scripts/charts-echarts.js:6:23
ChartsEcharts</<.initCharts@http://localhost:8080/assets/admin/pages/scripts/charts-echarts.js:23:13
EffectiveOrder</draw_hotel_daily_datatable/<@http://localhost:8080/assets/admin/pages/scripts/effective-order.js:50:13
processQueue@http://localhost:8080/assets/bower_components/angular/angular.js:14745:28
scheduleProcessQueue/<@http://localhost:8080/assets/bower_components/angular/angular.js:14761:27
$RootScopeProvider/this.$get</Scope.prototype.$eval@http://localhost:8080/assets/bower_components/angular/angular.js:15989:16
$RootScopeProvider/this.$get</Scope.prototype.$digest@http://localhost:8080/assets/bower_components/angular/angular.js:15800:15
$RootScopeProvider/this.$get</Scope.prototype.$apply@http://localhost:8080/assets/bower_components/angular/angular.js:16097:13
done@http://localhost:8080/assets/bower_components/angular/angular.js:10546:36
completeRequest@http://localhost:8080/assets/bower_components/angular/angular.js:10744:7
requestLoaded@http://localhost:8080/assets/bower_components/angular/angular.js:10685:1
TypeError: Cannot read property '__animators' of undefined
    at V.stopAnimation (echarts-all.js:3)
    at h.delFromMap (echarts-all.js:1)
    at o.delRoot (echarts-all.js:8)
    at o.delRoot (echarts-all.js:8)
    at V.delElement (echarts-all.js:1)
    at V.delShape (echarts-all.js:1)
    at Object.t.clear (echarts-all.js:12)
    at Object.t.dispose (echarts-all.js:12)
    at Object.i._disposeChartList (echarts-all.js:1)
    at Object.i.clear (echarts-all.js:1)(anonymous function) @ angular.js:12477ident.$get @ angular.js:9246processQueue @ angular.js:14753(anonymous function) @ angular.js:14761parent.$get.Scope.$eval @ angular.js:15989parent.$get.Scope.$digest @ angular.js:15800parent.$get.Scope.$apply @ angular.js:16097done @ angular.js:10546completeRequest @ angular.js:10744requestLoaded @ angular.js:10685

附上作图的option

option={"calculable": true,"toolbox": {"feature": {"magicType": {"show": true,"title": {"line": "折线图切换","stack": "堆积","bar": "柱形图切换","tiled": "平铺"},"type": ["bar","line","stack"]},"restore": {"show": true,"title": "还原"},"saveAsImage": {"show": true,"title": "保存为图片","type": "png","lang": ["点击保存"]},"dataView": {"show": true,"title": "数据视图","readOnly": false,"lang": ["数据视图","关闭","刷新"]}},"show": true,"y": 0},"tooltip": {"trigger": "axis"},"legend": {"data": ["正常成单","原因不明","新单欺诈","新单客人取消","已审满房","已审特殊满房","已审变价","已审客人取消","已审其他原因","已确认酒店取消","已确认酒店取消","已确认酒店取消","已确认客人取消","已确认其他原因","审核担保订单取消","审核删除(入住日以后删除的订单)","NOSHOW"],"y": "5%"},"grid": {"x2": "5%","y2": "10%","x": "5%","y": "60%"},"xAxis": [{"boundaryGap": false,"type": "category","data": ["2015-09-29","2015-09-30","2015-10-01","2015-10-02","2015-10-03","2015-10-04","2015-10-05","2015-10-06","2015-10-07","2015-10-08"]}],"yAxis": [{"type": "value"}],"series": [{"name": "正常成单","type": "line","stack": "总量","itemStyle": {"normal": {"areaStyle": {"type": "default"}}},"data": ["34531","15002","2700","-","-","-","-","205507","217867","-"]},{"name": "原因不明","type": "line","stack": "总量","itemStyle": {"normal": {"areaStyle": {"type": "default"}}},"data": ["0","0","0","-","-","-","-","0","0","-"]},{"name": "新单欺诈","type": "line","stack": "总量","itemStyle": {"normal": {"areaStyle": {"type": "default"}}},"data": ["2755","3081","3794","-","-","-","-","0","0","-"]},{"name": "新单客人取消","type": "line","stack": "总量","itemStyle": {"normal": {"areaStyle": {"type": "default"}}},"data": ["541","705","783","-","-","-","-","16248","12099","-"]},{"name": "已审满房","type": "line","stack": "总量","itemStyle": {"normal": {"areaStyle": {"type": "default"}}},"data": ["52337","65554","78503","-","-","-","-","39443","37874","-"]},{"name": "已审特殊满房","type": "line","stack": "总量","itemStyle": {"normal": {"areaStyle": {"type": "default"}}},"data": ["108340","112808","131897","-","-","-","-","12322","10964","-"]},{"name": "已审变价","type": "line","stack": "总量","itemStyle": {"normal": {"areaStyle": {"type": "default"}}},"data": ["18628","21837","23371","-","-","-","-","0","0","-"]},{"name": "已审客人取消","type": "line","stack": "总量","itemStyle": {"normal": {"areaStyle": {"type": "default"}}},"data": ["29977","34140","43097","-","-","-","-","5343","4251","-"]},{"name": "已审其他原因","type": "line","stack": "总量","itemStyle": {"normal": {"areaStyle": {"type": "default"}}},"data": ["3542","3647","3509","-","-","-","-","5","1","-"]},{"name": "已确认酒店取消","type": "line","stack": "总量","itemStyle": {"normal": {"areaStyle": {"type": "default"}}},"data": ["582","730","868","-","-","-","-","487","431","-"]},{"name": "已确认酒店取消","type": "line","stack": "总量","itemStyle": {"normal": {"areaStyle": {"type": "default"}}},"data": ["0","1","0","-","-","-","-","2806","2689","-"]},{"name": "已确认酒店取消","type": "line","stack": "总量","itemStyle": {"normal": {"areaStyle": {"type": "default"}}},"data": ["0","0","0","-","-","-","-","123","164","-"]},{"name": "已确认客人取消","type": "line","stack": "总量","itemStyle": {"normal": {"areaStyle": {"type": "default"}}},"data": ["45496","54574","59337","-","-","-","-","19132","13825","-"]},{"name": "已确认其他原因","type": "line","stack": "总量","itemStyle": {"normal": {"areaStyle": {"type": "default"}}},"data": ["0","0","0","-","-","-","-","16","26","-"]},{"name": "审核担保订单取消","type": "line","stack": "总量","itemStyle": {"normal": {"areaStyle": {"type": "default"}}},"data": ["0","0","0","-","-","-","-","89","77","-"]},{"name": "审核删除(入住日以后删除的订单)","type": "line","stack": "总量","itemStyle": {"normal": {"areaStyle": {"type": "default"}}},"data": ["0","0","0","-","-","-","-","3569","3403","-"]},{"name": "NOSHOW","type": "line","stack": "总量","itemStyle": {"normal": {"areaStyle": {"type": "default"}}},"data": ["0","0","0","-","-","-","-","19512","17856","-"]},{"center": ["30%","30%"],"radius": ["15%","25%"],"name": "2015-09-29至2015-10-08","type": "pie","tooltip": {"trigger": "item","formatter": "{a} <br/>{b} : {c} ({d}%)"},"itemStyle": {"normal": {"label": {"show": true},"labelLine": {"show": true}}},"data": [{"name": "正常成单","value": 475607},{"name": "原因不明","value": 0},{"name": "新单欺诈","value": 9630},{"name": "新单客人取消","value": 30376},{"name": "已审满房","value": 273711},{"name": "已审特殊满房","value": 376331},{"name": "已审变价","value": 63836},{"name": "已审客人取消","value": 116808},{"name": "已审其他原因","value": 10704},{"name": "已确认酒店取消","value": 3098},{"name": "已确认酒店取消","value": 5496},{"name": "已确认酒店取消","value": 287},{"name": "已确认客人取消","value": 192364},{"name": "已确认其他原因","value": 42},{"name": "审核担保订单取消","value": 166},{"name": "审核删除(入住日以后删除的订单)","value": 6972},{"name": "NOSHOW","value": 37368}]},{"center": ["70%","30%"],"radius": ["15%","25%"],"name": "2015-10-08","type": "pie","tooltip": {"trigger": "item","formatter": "{a} <br/>{b} : {c} ({d}%)"},"itemStyle": {"normal": {"label": {"show": true},"labelLine": {"show": true}}},"data": [{"name": "正常成单","value": "-"},{"name": "原因不明","value": "-"},{"name": "新单欺诈","value": "-"},{"name": "新单客人取消","value": "-"},{"name": "已审满房","value": "-"},{"name": "已审特殊满房","value": "-"},{"name": "已审变价","value": "-"},{"name": "已审客人取消","value": "-"},{"name": "已审其他原因","value": "-"},{"name": "已确认酒店取消","value": "-"},{"name": "已确认酒店取消","value": "-"},{"name": "已确认酒店取消","value": "-"},{"name": "已确认客人取消","value": "-"},{"name": "已确认其他原因","value": "-"},{"name": "审核担保订单取消","value": "-"},{"name": "审核删除(入住日以后删除的订单)","value": "-"},{"name": "NOSHOW","value": "-"}]}]}

Most helpful comment

确认错误,series name重复,legend也重复,导致作图失败,Uncaught TypeError: Cannot read property '__animators' of undefined。

保证彼此不重复后,正常作图。

All 10 comments

自己console 你的contentscript.js 234行咯,不是报错位置写的很清楚么

On Friday, 9 October 2015, Vimos Tan [email protected] wrote:

这个动画错误,现象:
作图成功,但很快闪断,只剩部分图例,其余是空白

Uncaught TypeError: Cannot read property '__animators' of undefined
V.stopAnimation @ echarts-all.js:3h.
delFromMap @ echarts-all.js:1
o.delRoot @ echarts-all.js:8
o.delRoot @ echarts-all.js:8
V.delElement @ echarts-all.js:1
V.delShape @ echarts-all.js:1
t.clear @ echarts-all.js:12
t.refresh @ echarts-all.js:4
i.refresh @ echarts-all.js:1
i._onrefresh @ echarts-all.js:1
i.__onevent @ echarts-all.js:1
i._init._onevent @ echarts-all.js:1
e.dispatchWithContext @ echarts-all.js:7
i._init._messageCenter.dispatch @ echarts-all.js:1
i._onlegendSelected @ echarts-all.js:1
i.__onevent @ echarts-all.js:1
i._init._onevent @ echarts-all.js:1
e.dispatchWithContext @ echarts-all.js:7
i._init._messageCenter.dispatch @ echarts-all.js:1
t.__legendSelected @ echarts-all.js:4
r._legendSelected @ echarts-all.js:4
u._dispatchAgency @ echarts-all.js:8
c.click @ echarts-all.js:7
(anonymous function) @ echarts-all.js:7
contentScript.js:234 cs: onRequestListener(Arguments[3])


Reply to this email directly or view it on GitHub
https://github.com/ecomfe/echarts/issues/2077.

更新了错误提示。
脱离我的代码,直接采用附的option作图,也会报相同的错误。
只需要点击一下legend,就会报。

那就是option配置错了呗

On Friday, 9 October 2015, Vimos Tan [email protected] wrote:

更新了错误提示。
脱离我的代码,直接采用附的option作图,也会报相同的错误。
只需要点击一下legend,就会报。


Reply to this email directly or view it on GitHub
https://github.com/ecomfe/echarts/issues/2077#issuecomment-146762306.

比如说 某些值是null什么的

On Friday, 9 October 2015, xk su [email protected] wrote:

那就是option配置错了呗

On Friday, 9 October 2015, Vimos Tan <[email protected]

更新了错误提示。
脱离我的代码,直接采用附的option作图,也会报相同的错误。
只需要点击一下legend,就会报。


Reply to this email directly or view it on GitHub
https://github.com/ecomfe/echarts/issues/2077#issuecomment-146762306.

附中的option应该不含有null,最担心的是少给了什么属性,但是我却不知道。

你setoption几次?

On Friday, 9 October 2015, Vimos Tan [email protected] wrote:

附中的option应该不含有null,最担心的是少给了什么属性,但是我却不知道。


Reply to this email directly or view it on GitHub
https://github.com/ecomfe/echarts/issues/2077#issuecomment-146769929.

如果你是多次set option,第二次之后没设置一些东西比如legend,只设置了数据可能会这样吧

On Friday, 9 October 2015, xk su [email protected] wrote:

你setoption几次?

On Friday, 9 October 2015, Vimos Tan <[email protected]

附中的option应该不含有null,最担心的是少给了什么属性,但是我却不知道。


Reply to this email directly or view it on GitHub
https://github.com/ecomfe/echarts/issues/2077#issuecomment-146769929.

初步判断是stack的name,series的name重复导致作图失败

建议尝试每次都 全的option no merge
Setoption(full-new-option,true)

On Friday, 9 October 2015, Vimos Tan [email protected] wrote:

初步判断是stack的name,series的name重复导致作图失败


Reply to this email directly or view it on GitHub
https://github.com/ecomfe/echarts/issues/2077#issuecomment-146806118.

确认错误,series name重复,legend也重复,导致作图失败,Uncaught TypeError: Cannot read property '__animators' of undefined。

保证彼此不重复后,正常作图。

Was this page helpful?
0 / 5 - 0 ratings