修改bug
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-12-27 13:54:52
|
||||
* @LastEditTime: 2024-03-28 16:30:14
|
||||
* @LastEditTime: 2024-03-29 16:50:47
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div>
|
||||
<div :id="id" class="productChart" :style="{ height: height + 'px', width: width }" />
|
||||
<div :id="id" class="productChart" :style="{ height:'80px', width: width }" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -106,7 +106,6 @@ export default {
|
||||
}
|
||||
// }
|
||||
console.log('total', totalData)
|
||||
this.chart = echarts.init(document.getElementById(this.id))
|
||||
const series = [
|
||||
'良品',
|
||||
'废品',
|
||||
@@ -137,6 +136,17 @@ export default {
|
||||
// width,
|
||||
// height
|
||||
// })
|
||||
this.chart = echarts.init(document.getElementById(this.id))
|
||||
let isFinished = false //标记 isFinished
|
||||
this.chart.on('finished', _ => {
|
||||
if (!isFinished) {
|
||||
console.log('我只执行一次')
|
||||
isFinished = true
|
||||
// this.isLoading = false //关闭loading
|
||||
this.chart.resize() //重新渲染charts大小
|
||||
}
|
||||
console.log(113, 'finished')
|
||||
})
|
||||
this.chart.setOption({
|
||||
legend: {
|
||||
formatter: function (name) {
|
||||
@@ -152,7 +162,8 @@ export default {
|
||||
left: '20',
|
||||
icon: 'rect',
|
||||
textStyle: {
|
||||
color: '#ffffff'
|
||||
color: 'rgba(255,255,255,.6)',
|
||||
fontSize:12,
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
@@ -184,9 +195,9 @@ export default {
|
||||
splitNumber: 50,
|
||||
// boundaryGap: [20, 20],
|
||||
textStyle: {
|
||||
color: '#ffffff',
|
||||
color: 'rgba(255,255,255,.6)',
|
||||
verticalAlign: 'bottom',
|
||||
fontSize: 12,
|
||||
fontSize: 16,
|
||||
align: 'left',
|
||||
padding: [0, 0, 10, -5]
|
||||
}
|
||||
@@ -212,9 +223,9 @@ export default {
|
||||
splitNumber: 50,
|
||||
// boundaryGap: [20, 20],
|
||||
textStyle: {
|
||||
color: '#ffffff',
|
||||
color: 'rgba(255,255,255,.6)',
|
||||
verticalAlign: 'bottom',
|
||||
fontSize: 12,
|
||||
fontSize: 16,
|
||||
align: 'right',
|
||||
padding: [0, 0, 10, -5]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user