echarts多表图第一次显示不出来(如图一),刷新或者第二次就可以显示出来,)如图二,求解决方案
function gauges() {
var gaugesChart = echarts.init(document.getElementById("gauges_component_"+comid+""+code+""));
if(value1num == "" || value1num == null){
value1num = "--";
unit = "";
}
var gaugesOption = {
tooltip: {
formatter: "{a} <br/>{b} : {c}"
},
title: {
//text: "读数:" + value1,
},
animation: false,
toolbox: {
show: false,
feature: {}
},
series: [
{
//name: '读数',
type: 'gauge',
detail: {
formatter: '{value}'+unit,
textStyle: {
fontSize: 22
}
},
data: [{
value:value1num,
name: '读数'
}],
max: fullRangenum,
min: 0,
axisLine: {
show: true,
lineStyle: {
color: [
[minnum / fullRangenum, '#228b22'],
[maxnum / fullRangenum, '#48b'],
[1, '#FF7F50']
],
width: 90
}
},
splitLine: {
show: true,
length: -30,
lineStyle: {
color: '#eee',
width: 2,
type: 'solid'
}
},
pointer: {
length: '80%',
width: 8,
color: '#27408B'
}
}
]
};
gaugesChart.setOption(gaugesOption);
}
Console: [file:///E:/java_gao/TT/%e7%a0%81%e4%ba%91%e4%b8%8aTF1000N/TF1000N02/out/production/TF1000N/assets/web/echarts-all.js:13] IndexSizeError: DOM Exception 1: Index or size was negative, or greater than the allowed value.
Console: [file:///E:/java_gao/TT/%e7%a0%81%e4%ba%91%e4%b8%8aTF1000N/TF1000N02/out/production/TF1000N/assets/web/echarts-all.js:13] IndexSizeError: DOM Exception 1: Index or size was negative, or greater than the allowed value.
Console: [file:///E:/java_gao/TT/%e7%a0%81%e4%ba%91%e4%b8%8aTF1000N/TF1000N02/out/production/TF1000N/assets/web/echarts-all.js:13] IndexSizeError: DOM Exception 1: Index or size was negative, or greater than the allowed value.
控制台一直重复报这个。