You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@echarts.apache.org by GitBox <gi...@apache.org> on 2018/06/19 01:20:08 UTC
[GitHub] wahgar opened a new issue #8538: Uncaught TypeError: Cannot read
property '0' of undefined
wahgar opened a new issue #8538: Uncaught TypeError: Cannot read property '0' of undefined
URL: https://github.com/apache/incubator-echarts/issues/8538
<!--
$.ajax({
method : 'GET',
url : 'http://192.168.123.30/PIS/GetStationStatus.aspx?Line='+getUrlParam("name"),
success : function(result) {
// console.info(result);
var jsonObj = $.parseJSON(result);
var obj0 = [],
obj1 = [],
obj2 = [],
obj3 = [];
for(var o in geo)
{
for (var i = 0; i < jsonObj.Data.length; i++)
{
if(o==jsonObj.Data[i].STATION_NAME)
{
var arr = {"name":jsonObj.Data[i].STATION_NAME,"value":parseInt(jsonObj.Data[i].STATUS)};
myChart.delMarkPoint(0,jsonObj.Data[i].STATION_NAME);
var value1=parseInt(jsonObj.Data[i].STATUS);
if (value1 === 0)
obj0.push(arr);
if (value1 === 1)
obj1.push(arr);
if (value1 === 2)
obj2.push(arr);
if (value1 === 3)
obj3.push(arr);
break;
}
}
}
idle = {
symbol : 'emptyCircle',
symbolSize : function (v){
return 10 + v/10
},
itemStyle : {
normal : {
color : '#6f6f6f',
},
},
effect : {
show : true,
color : '#6f6f6f',
shadowBlur : 0
},
data : obj0,
};
run = {
symbol : 'emptyCircle',
symbolSize : function (v){
return 10 + v/10
},
itemStyle : {
normal : {
color : '#00CC00',
},
},
effect : {
show : true,
color : '#00CC00',
shadowBlur : 0
},
data : obj1,
};
alarm = {
symbol : 'emptyCircle',
symbolSize : function (v){
return 10 + v/10
},
itemStyle : {
normal : {
color : '#CCFF00',
},
},
effect : {
show : true,
color : '#CCFF00',
shadowBlur : 0
},
data : obj2,
};
breakdown = {
symbol : 'emptyCircle',
symbol : 'emptyCircle',
symbolSize : function (v){
return 10 + v/10
},
itemStyle : {
normal : {
color : '#FF0000',
},
effect : {
show : true,
color : '#FF0000',
shadowBlur : 0
},
data : obj3,
};
// 加载动画
myChart.showLoading();
myChart.addMarkPoint(0, idle);
myChart.addMarkPoint(0, run);
myChart.addMarkPoint(0, alarm);
myChart.addMarkPoint(0, breakdown);
// 结束加载
myChart.hideLoading();
-->
### One-line summary [问题简述]
加载页面会出现以下报错,多刷新几次页面显示正常,没有以下报错,在循环定时刷新上面的代码,不会出现以下报错,显示正常。
map.js:1 Uncaught TypeError: Cannot read property '0' of undefined
at t.getMarkCoord (map.js:1)
at t._buildMarkPoint (base.js:630)
at t.addMark (base.js:1656)
at i._addMark (echarts.js:1)
at i.addMarkPoint (echarts.js:1)
at Object.success (smt1.js:396)
at o (jquery-1.7.2.min.js:2)
at Object.fireWith [as resolveWith] (jquery-1.7.2.min.js:2)
at w (jquery-1.7.2.min.js:4)
at XMLHttpRequest.d (jquery-1.7.2.min.js:4)
### Version & Environment [版本及环境]
+ ECharts version [ECharts 版本]:
echarts 2.2.7
+ Browser version [浏览器类型和版本]:
+ OS Version [操作系统类型和版本]:
### Expected behaviour [期望结果]
### ECharts option [ECharts配置项]
<!-- Copy and paste your 'echarts option' here. -->
<!-- [下方贴你的option,注意不要删掉下方 ```javascript 和 尾部的 ``` 字样。最好是我们能够直接运行的 option。如何得到能运行的 option 参见上方的 guidelines for contributing] -->
```javascript
option = {
}
```
### Other comments [其他信息]
<!-- For example: Screenshot or Online demo -->
<!-- [例如,截图或线上实例 (JSFiddle/JSBin/Codepen)] -->
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@echarts.apache.org
For additional commands, e-mail: dev-help@echarts.apache.org