Browse Source

【新增】饼状图跳转功能实现

master
chenjingyu 4 years ago
parent
commit
d0620a5188
  1. 4
      src/app/statistic-analysis/state/page-one/page-one.component.html
  2. 14
      src/app/statistic-analysis/state/page-one/page-one.component.ts

4
src/app/statistic-analysis/state/page-one/page-one.component.html

@ -4,12 +4,12 @@
* @Author: sueRimn * @Author: sueRimn
* @Date: 2020-09-01 15:24:39 * @Date: 2020-09-01 15:24:39
* @LastEditors: sueRimn * @LastEditors: sueRimn
* @LastEditTime: 2020-09-02 14:25:47 * @LastEditTime: 2020-09-02 14:49:05
--> -->
<body> <body>
<!--饼状图 --> <!--饼状图 -->
<div id="indexBzt" style="width: 100%;height: 100%;" ></div> <div id="indexBzt" style="width: 100%;height: 100%;"></div>
</body> </body>

14
src/app/statistic-analysis/state/page-one/page-one.component.ts

@ -4,9 +4,10 @@
* @Author: sueRimn * @Author: sueRimn
* @Date: 2020-09-01 15:24:39 * @Date: 2020-09-01 15:24:39
* @LastEditors: sueRimn * @LastEditors: sueRimn
* @LastEditTime: 2020-09-02 14:30:48 * @LastEditTime: 2020-09-02 14:59:21
*/ */
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
//import * as echarts from ''; //import * as echarts from '';
declare var echarts: any; declare var echarts: any;
@ -19,13 +20,15 @@ export class PageOneComponent implements OnInit {
options:any; options:any;
constructor() { } constructor(private router: Router) { }
ngOnInit() { ngOnInit() {
window.setTimeout(()=>{ window.setTimeout(()=>{
this.initCharts() this.initCharts()
},0) },0)
} }
/* 饼状图跳转 */
/* 首页饼状图 */ /* 首页饼状图 */
initCharts(){ initCharts(){
//console.log(document.getElementById('indexBzt')) //console.log(document.getElementById('indexBzt'))
@ -96,7 +99,12 @@ export class PageOneComponent implements OnInit {
} }
} }
] ]
}; };
indexBzt.on('click', (params) => {
console.log(999)
this.router.navigateByUrl('/statisticanalysis/statePageTwo_time');
// this.router.navigate(["/statisticanalysis/statePageTwo_time"])
});
indexBzt.setOption(options); indexBzt.setOption(options);
} }
/** /**

Loading…
Cancel
Save