|
@@ -541,13 +541,20 @@ export default {
|
|
|
}]
|
|
|
}
|
|
|
if (this.defectStatus === 7) { // 如果是缺陷类型,则增加二级饼图
|
|
|
- const childArr = this.chart1Data.xaxis.map((item, index) => {
|
|
|
+ // this.echartsOption1.legend.data = [...this.chart1Data.xaxis, ...this.chartChildData.xaxis]
|
|
|
+ const childArr = this.chartChildData.xaxis.map((item, index) => {
|
|
|
return {
|
|
|
value: this.chartChildData.yaxis[0] && this.chartChildData.yaxis[0].data[index] || null,
|
|
|
name: item
|
|
|
}
|
|
|
})
|
|
|
- this.echartsOption1.series.push({ name: '缺陷数量', type: 'pie', radius: ['0', '44%'], right: '30%', label: { position: 'inner' }, data: childArr, animation: false })
|
|
|
+ this.echartsOption1.series = [
|
|
|
+ {
|
|
|
+ name: '缺陷数量', type: 'pie', radius: ['45%', '60%'], right: '30%', label: { position: 'outer' }, data: childArr,
|
|
|
+ itemStyle: { normal: { label: { show: true, formatter: '{b} : {c} ({d}%)' }, labelLine: { show: true }}}
|
|
|
+ },
|
|
|
+ { name: '缺陷数量', type: 'pie', radius: ['0', '44%'], right: '30%', label: { position: 'inner', alignTo: 'edge', margin: 20 }, data: newArr, animation: false }
|
|
|
+ ]
|
|
|
}
|
|
|
}
|
|
|
},
|