| | |
| | | //#endregion |
| | | |
| | | //æ±ç¶å¾ç»å®æ°æ® |
| | | var MaterialMap = {}; |
| | | option.data.forEach(function (item) { |
| | | var batchNo = item['lotæ¹æ¬¡å·'] || item['HBatchNo']; |
| | | var materialNo = item['æå·']; |
| | | if (batchNo && materialNo) { |
| | | MaterialMap[batchNo] = materialNo; |
| | | } |
| | | }); |
| | | // 1. ææ¹æ¬¡å·åç»èå |
| | | var batchMap = {}; |
| | | option.data.forEach(function (item) { |
| | |
| | | trigger: 'axis', |
| | | axisPointer: { |
| | | type: 'shadow' |
| | | }, |
| | | formatter: function (params) { |
| | | var batchNo = params[0].name; |
| | | var materialNo = MaterialMap[batchNo] || 'æªç¥æå·'; |
| | | var result = '<div style="font-weight:bold; margin-bottom:8px; color:#2c3e50; font-size:15px;">æ¹æ¬¡å·: ' + batchNo + '</div>'; |
| | | result += '<div style="font-weight:bold; margin-bottom:15px; color:#6a11cb; font-size:15px; border-bottom:1px solid #eee; padding-bottom:10px;">æå·: ' + materialNo + '</div>'; |
| | | |
| | | params.forEach(function (item) { |
| | | var color = item.color; |
| | | var value = item.value; |
| | | |
| | | if (item.seriesName === 'ä¸è¯ç') { |
| | | result += '<div style="display:flex; align-items:center; margin:8px 0;">'; |
| | | result += '<span style="display:inline-block; width:14px; height:14px; border-radius:2px; background:' + color + '; margin-right:10px;"></span>'; |
| | | result += '<span style="color:#555; width:70px;">' + item.seriesName + ': </span>'; |
| | | result += '<span style="font-weight:bold; color:#e04b45; margin-left:5px; font-size:15px;">' + value + '%</span>'; |
| | | result += '</div>'; |
| | | } else { |
| | | result += '<div style="display:flex; align-items:center; margin:8px 0;">'; |
| | | result += '<span style="display:inline-block; width:14px; height:14px; border-radius:2px; background:' + color + '; margin-right:10px;"></span>'; |
| | | result += '<span style="color:#555; width:70px;">' + item.seriesName + ': </span>'; |
| | | result += '<span style="font-weight:bold; color:#2c3e50; margin-left:5px; font-size:15px;">' + value + '</span>'; |
| | | result += '</div>'; |
| | | } |
| | | }); |
| | | return result; |
| | | } |
| | | }, |
| | | legend: { |