Browse Source

数据统计图没有销毁导致数据迭代问题

master
aBin 4 years ago
parent
commit
f9302d0e89
  1. 2
      src/App.vue
  2. 7
      src/components/Echarts/Categorymap.vue
  3. 5
      src/components/Echarts/CategorymapHos.vue
  4. 7
      src/components/Echarts/Treemap.vue

2
src/App.vue

@ -3,7 +3,7 @@
* @email: 18603454788@163.com * @email: 18603454788@163.com
* @Date: 2021-04-19 10:23:19 * @Date: 2021-04-19 10:23:19
* @LastEditors: wally * @LastEditors: wally
* @LastEditTime: 2021-05-20 11:36:06 * @LastEditTime: 2021-05-20 18:56:20
--> -->
<template> <template>
<a-config-provider :locale="zh_CN"> <a-config-provider :locale="zh_CN">

7
src/components/Echarts/Categorymap.vue

@ -3,7 +3,7 @@
* @email: 18603454788@163.com * @email: 18603454788@163.com
* @Date: 2021-01-29 14:45:02 * @Date: 2021-01-29 14:45:02
* @LastEditors: wally * @LastEditors: wally
* @LastEditTime: 2021-05-14 09:46:26 * @LastEditTime: 2021-05-20 18:48:35
--> -->
<template> <template>
<!-- <div>数据统计组件</div> --> <!-- <div>数据统计组件</div> -->
@ -55,10 +55,7 @@ export default {
// //
await this.getData(); await this.getData();
var option = { var option = {
legend: { legend: { data: ['新建', '数据收集按时完成', '数据收集中', '废弃', '数据收集超时'] },
data: ['新建', '数据收集按时完成', '数据收集中', '废弃', '数据收集超时'],
top: 30,
},
xAxis: [ xAxis: [
{ {
type: 'category', type: 'category',

5
src/components/Echarts/CategorymapHos.vue

@ -42,10 +42,7 @@ export default {
await this.getData(this.hospitalId); await this.getData(this.hospitalId);
// //
var option = { var option = {
legend: { legend: { data: ['新建', '数据收集按时完成', '数据收集中', '废弃', '数据收集超时'] },
data: ['新建', '数据收集按时完成', '数据收集中', '废弃', '数据收集超时'],
top: 30,
},
xAxis: [ xAxis: [
{ {
type: 'category', type: 'category',

7
src/components/Echarts/Treemap.vue

@ -64,8 +64,11 @@ export default {
async drawLine() { async drawLine() {
// domecharts // domecharts
await this.getData(); await this.getData();
let myChart = this.$echarts.init(document.getElementById('Treemap')); let myChart = document.getElementById('Treemap');
myChart.setOption(this.option); //
myChart.removeAttribute('_echarts_instance_');
let myChart1 = this.$echarts.init(myChart);
myChart1.setOption(this.option);
}, },
async getData() { async getData() {
try { try {

Loading…
Cancel
Save