From 6355169a5f3953f3862ba9a5df91d9f2804d5895 Mon Sep 17 00:00:00 2001 From: cpf <1105965053@qq.com> Date: Thu, 10 Sep 2020 16:09:10 +0800 Subject: [PATCH] =?UTF-8?q?[=E4=BF=AE=E6=AD=A3]=20echarts=E7=9B=91?= =?UTF-8?q?=E5=90=AC=E9=A1=B5=E9=9D=A2=E5=88=86=E8=BE=A8=E7=8E=87=E5=8F=98?= =?UTF-8?q?=E5=8C=96=20=E9=87=8D=E6=96=B0=E6=B8=B2=E6=9F=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../statistic-analysis/home/home.component.ts | 22 ++++++------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/src/app/statistic-analysis/home/home.component.ts b/src/app/statistic-analysis/home/home.component.ts index f7748a0..40d74b9 100644 --- a/src/app/statistic-analysis/home/home.component.ts +++ b/src/app/statistic-analysis/home/home.component.ts @@ -14,7 +14,6 @@ export class HomeComponent implements OnInit { constructor(private http:HttpClient, private render2: Renderer2,public element: ElementRef,private router: Router,public emitService: EchartsDataService) { } - map:any; //地图 ngOnInit() { this.emitService.eventEmit.subscribe((value: any) => { @@ -24,25 +23,18 @@ export class HomeComponent implements OnInit { }, 500); } }); + window.addEventListener('resize', () => { + setTimeout(() => { + this.updateEcharts() + }, 0); + }) + window.setTimeout(()=>{ this.unitType() this.unitData() this.keyUnit() this.mapInit() //初始化地图 - let that = this },0) - window.addEventListener('resize', () => { - setTimeout(() => { - this.updateEcharts() - }, 500); - }) - window.addEventListener('keydown', (e) => { - if(e.keyCode == 122){ - setTimeout(() => { - this.updateEcharts() - }, 500); - } - }) } //更新echarts视图 @@ -57,7 +49,7 @@ export class HomeComponent implements OnInit { this.unitType() this.unitData() this.keyUnit() - // this.mapInit() //初始化地图 + } threePlan(){