1 回答
TA贡献1779条经验 获得超6个赞
实现了,要在里面二次拼接,实现代码如下:
//TAT
var rounds = document.querySelector('div.round');
var _watchHtml = '';
this._valueDatas.forEach(function (value,index,array) {
value = eval('('+ value +')');
console.log(value)
var maxTat = value.c3text; //总值 100
var fwcTat = value.c4text; //警报值 60
var difTat = (maxTat - fwcTat); //安全值 100-60 = 40
var colors = difTat/100;
var _valueLengths = value.c3text.length;
_watchHtml += '<div class="watchBox"><div class="watch w'+index+'"></div></div>'
var wat=document.createElement('div');
wat.setAttribute('class','watchBox');
wat.innerHTML='<div class="watch w'+index+'"></div>';
// rounds.innerHTML = _watchHtml;
rounds.appendChild(wat)
//仪表盘配置参数
var watch = echarts.init(document.querySelector('.w'+index));
})
添加回答
举报