@@ -73,7 +73,7 @@ export default {
this.chart = null
},
methods: {
- initChart(xAxis, seriesList) {
+ initChart(xAxis, seriesList,arr) {
if (xAxis.length === 0) {
this.chart.clear()
}
@@ -103,18 +103,23 @@ export default {
type: 'shadow',
color: "rgba(237,237,237,0.5)"
},
- formatter: function(params) {
+ formatter: function (params) {
+ // console.log(params)
+ let str = ''
+ arr.forEach(ele => {
+ str += `${ele.name.substring(0, 2) }
`
+ })
+ console.log(str);
let result = `
${params[0].name}
-
${factoryListabbr[0]}
-
${factoryListabbr[1]}
+ ${str}
`
const newArray = params.map(p => {
console.log(factoryListabbr[p.seriesName.split('-')[1]], p.seriesName.split('-')[0])
return {
glass: p.seriesName.split('-')[0], // 玻璃类型
- factoryName: factoryListabbr[p.seriesName.split('-')[1]], // 工厂名称
+ factoryName: arr[p.seriesName.split('-')[1]], // 工厂名称
value: p.value,
name: p.name,
marker: p.marker,
@@ -128,7 +133,7 @@ export default {
`
- for (let fac of factoryListabbr) {
+ for (let fac of arr) {
let goodNum = 0
for (let ana of analyzeList[g]) {
if (ana.factoryName === fac && ana.value !== 0) {
@@ -139,6 +144,7 @@ export default {
}
result = result + oneData + ''
}
+ // console.log('result', result);
return result
}
},