Browse Source

监听数据变化重渲染echarts

master
j1ack 3 years ago
parent
commit
2ebdc58b8c
  1. 8
      src/components/companySummary/business.vue
  2. 9
      src/components/companySummary/talent.vue
  3. 8
      src/components/ringPie/index.vue
  4. 8
      src/components/scrollArc/index.vue
  5. 11
      src/components/szBar/index.vue

8
src/components/companySummary/business.vue

@ -17,6 +17,14 @@ export default {
data() {
return {
}
},
watch: {
chartData: {
deep: true,
handler: function () {
this.getEchartLeft1()
}
}
},
mounted() {
setTimeout(() => {

9
src/components/companySummary/talent.vue

@ -44,6 +44,15 @@ export default {
created() {
},
watch: {
chartData: {
deep: true,
handler: function () {
this.getEchartLeft2()
}
}
},
mounted() {
setTimeout(() => {
// console.log(this.chartData)

8
src/components/ringPie/index.vue

@ -49,6 +49,14 @@ export default {
this.shenRate=100-this.dataRate
this.getEchart();
}, 800);
},
watch: {
chartData: {
deep: true,
handler: function () {
this.getEchart()
}
}
},
methods: {
getEchart() {

8
src/components/scrollArc/index.vue

@ -38,6 +38,14 @@ export default {
dataIn: [],
dataOut: [],
}
},
watch: {
chartData: {
deep: true,
handler: function () {
this.getEchart()
}
}
},
mounted() {
setTimeout(() => {

11
src/components/szBar/index.vue

@ -30,6 +30,14 @@ export default {
yData1: [],
}
},
watch: {
chartData: {
deep: true,
handler: function () {
this.getEchart()
}
}
},
mounted() {
setTimeout(() => {
// console.log(this.chartData)
@ -40,6 +48,7 @@ export default {
this.getEchart();
}, 800);
},
methods: {
getEchart() {
let myChart = echarts.init(document.getElementById('chart_bar'));
@ -195,11 +204,13 @@ export default {
height: 3rem;
}
}
.sn-container {
left: 975px;
top: 690px;
width: 895px;
height: 400px;
.chartsdom {
width: 100%;
height: 95%;

Loading…
Cancel
Save