|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
import { Component, OnInit } from '@angular/core'; |
|
|
|
|
import { Router } from '@angular/router'; |
|
|
|
|
import { HttpClient } from '@angular/common/http' |
|
|
|
|
import {EchartsDataService,} from '../../echarts-data.service' |
|
|
|
|
declare var echarts: any; |
|
|
|
|
@Component({ |
|
|
|
@ -9,7 +10,7 @@ declare var echarts: any;
|
|
|
|
|
}) |
|
|
|
|
export class BuildingTypeOneComponent implements OnInit { |
|
|
|
|
|
|
|
|
|
constructor(private router: Router,public echartsData:EchartsDataService) { } |
|
|
|
|
constructor(private http:HttpClient,private router: Router,public echartsData:EchartsDataService) { } |
|
|
|
|
|
|
|
|
|
ngOnInit(): void { |
|
|
|
|
window.setTimeout(()=>{ |
|
|
|
@ -22,11 +23,23 @@ export class BuildingTypeOneComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
/* 首页饼状图 */ |
|
|
|
|
indexBzt |
|
|
|
|
lengthdata=[]//提示数据
|
|
|
|
|
count=0//总数
|
|
|
|
|
indexData=[]//所有数据
|
|
|
|
|
initCharts(){ |
|
|
|
|
this.indexBzt = echarts.init(document.getElementById('indexBzt'),'walden'); |
|
|
|
|
this.http.get("/api/StatisticsAnalysis").subscribe((data:any)=>{ |
|
|
|
|
for(var i=0;i<data.companyStatistics.buildingTypeStatistics.buildingTypes.length;i++){ |
|
|
|
|
this.lengthdata.push(data.companyStatistics.buildingTypeStatistics.buildingTypes[i].buildingTypeName) |
|
|
|
|
this.count=this.count+data.companyStatistics.buildingTypeStatistics.buildingTypes[i].count |
|
|
|
|
this.indexData.push(data.companyStatistics.buildingTypeStatistics.buildingTypes[i]) |
|
|
|
|
} |
|
|
|
|
//JSON.parse(JSON.stringify(this.indexData).replace(/buildingTypeName/g, 'name'))
|
|
|
|
|
this.indexData=this.indexData.map(v=>{return {name: v.buildingTypeName,value:v.count}}) |
|
|
|
|
console.log(this.indexData) |
|
|
|
|
this.indexBzt = echarts.init(document.getElementById('indexBzt'),'walden'); |
|
|
|
|
let options={ |
|
|
|
|
title: { |
|
|
|
|
text: '建筑类型统计(8900家)', |
|
|
|
|
text: `建筑类型统计(${this.count}家)`, |
|
|
|
|
left: 'center', |
|
|
|
|
top: "7%", |
|
|
|
|
textStyle: { |
|
|
|
@ -48,7 +61,7 @@ export class BuildingTypeOneComponent implements OnInit {
|
|
|
|
|
fontSize:18, |
|
|
|
|
color:"#000000" |
|
|
|
|
},
|
|
|
|
|
data: ['高层', '地下', '轨道交通', '化工生产', '储罐类' , '厂房','古建筑', '商市场', '医院', '学校', '宾馆' , '娱乐场所','餐饮业', '影剧院', '展览建筑' , '隧道'] |
|
|
|
|
data: this.lengthdata |
|
|
|
|
}, |
|
|
|
|
series: [ |
|
|
|
|
{ |
|
|
|
@ -67,24 +80,24 @@ export class BuildingTypeOneComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
data: [ |
|
|
|
|
{value: 500, name: '高层'}, |
|
|
|
|
{value: 800, name: '地下'}, |
|
|
|
|
{value: 900, name: '轨道交通'}, |
|
|
|
|
{value: 800, name: '化工生产'}, |
|
|
|
|
{value: 1200, name: '储罐类'}, |
|
|
|
|
{value: 1500, name: '厂房'}, |
|
|
|
|
{value: 1400, name: '古建筑'}, |
|
|
|
|
{value: 600, name: '商市场'}, |
|
|
|
|
{value: 568, name: '医院'}, |
|
|
|
|
{value: 888, name: '学校'}, |
|
|
|
|
{value: 485, name: '宾馆'}, |
|
|
|
|
{value: 966, name: '娱乐场所'}, |
|
|
|
|
{value: 789, name: '餐饮业'}, |
|
|
|
|
data:/* [ |
|
|
|
|
{value: this.indexData[0].count, name: this.indexData[0].buildingTypeName}, |
|
|
|
|
{value: this.indexData[1].count, name: this.indexData[1].buildingTypeName}, |
|
|
|
|
{value: this.indexData[2].count, name: this.indexData[2].buildingTypeName}, |
|
|
|
|
{value: this.indexData[3].count, name: this.indexData[3].buildingTypeName}, |
|
|
|
|
{value: this.indexData[4].count, name: this.indexData[4].buildingTypeName}, |
|
|
|
|
{value: this.indexData[5].count, name: this.indexData[5].buildingTypeName}, |
|
|
|
|
{value: this.indexData[6].count, name: this.indexData[6].buildingTypeName}, |
|
|
|
|
{value: this.indexData[7].count, name: this.indexData[7].buildingTypeName}, |
|
|
|
|
{value: this.indexData[8].count, name: this.indexData[8].buildingTypeName}, |
|
|
|
|
{value: this.indexData[9].count, name: this.indexData[9].buildingTypeName}, |
|
|
|
|
{value: this.indexData[10].count, name: this.indexData[0].buildingTypeName}, |
|
|
|
|
{value: this.indexData[0].count, name: this.indexData[0].buildingTypeName}, |
|
|
|
|
{value: this.indexData[0].count, name: this.indexData[0].buildingTypeName}, |
|
|
|
|
{value: 500, name: '影剧院'}, |
|
|
|
|
{value: 1025, name: '展览建筑'}, |
|
|
|
|
{value: 600, name: '隧道'} |
|
|
|
|
], |
|
|
|
|
{value: 600, name: '隧道'}
|
|
|
|
|
] */this.indexData, |
|
|
|
|
emphasis: { |
|
|
|
|
itemStyle: { |
|
|
|
|
shadowBlur: 10, |
|
|
|
@ -99,6 +112,9 @@ export class BuildingTypeOneComponent implements OnInit {
|
|
|
|
|
this.router.navigate(['/statisticanalysis/buildingType_one/buildingType_two_reverse'],{queryParams:{'level':params.name}}); |
|
|
|
|
}); |
|
|
|
|
this.indexBzt.setOption(options); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
biaogeTishi(biaotou:string){ |
|
|
|
|
var shuju='[{"name":"浦东支队","number":"156","zhanbi":"3%"},{"name":"黄浦支队","number":"144","zhanbi":"2.8%"},' |
|
|
|
|