diff --git a/src/app/statistic-analysis/buildingType/building-type-one/building-type-one.component.ts b/src/app/statistic-analysis/buildingType/building-type-one/building-type-one.component.ts index 2768d0c..42c8ee2 100644 --- a/src/app/statistic-analysis/buildingType/building-type-one/building-type-one.component.ts +++ b/src/app/statistic-analysis/buildingType/building-type-one/building-type-one.component.ts @@ -14,7 +14,12 @@ export class BuildingTypeOneComponent implements OnInit { constructor(private http:HttpClient,private router: Router,public echartsData:EchartsDataService) { } ngOnInit(): void { - + if(window.matchMedia("(max-width: 1300px)").matches&&window.matchMedia("(max-height: 700px)").matches){ + this.padHw=true + //this.padjt= + }else{ + this.padHw=false + } this.echartsData.getData(null,`/api/StatisticsAnalysis/BuildingTypes`) window.setTimeout(()=>{ this.initCharts() @@ -26,6 +31,7 @@ export class BuildingTypeOneComponent implements OnInit { } /* 首页饼状图 */ indexBzt + padHw lengthdata=[]//提示数据 count=0//总数 indexData=[]//所有数据 @@ -65,8 +71,8 @@ export class BuildingTypeOneComponent implements OnInit { }, legend: { orient: 'vertical', - right: 150, - top:80, + right: this.padHw?150:250, + top:60, textStyle:{ fontSize:18, color:"#000000" @@ -75,7 +81,7 @@ export class BuildingTypeOneComponent implements OnInit { }, series: [ { - //top:'15%', + top:this.padHw?'15%':'0', name: '访问来源', type: 'pie', radius: '60%', diff --git a/src/app/statistic-analysis/buildingType/building-type-two-reverse/building-type-two-reverse.component.ts b/src/app/statistic-analysis/buildingType/building-type-two-reverse/building-type-two-reverse.component.ts index 3c59913..490c9b9 100644 --- a/src/app/statistic-analysis/buildingType/building-type-two-reverse/building-type-two-reverse.component.ts +++ b/src/app/statistic-analysis/buildingType/building-type-two-reverse/building-type-two-reverse.component.ts @@ -20,7 +20,14 @@ export class BuildingTypeTwoReverseComponent implements OnInit { } headname//标题 buildId//建筑id + padHw//是否是华为pad ngOnInit(): void { + if(window.matchMedia("(max-width: 1300px)").matches&&window.matchMedia("(max-height: 700px)").matches){ + this.padHw=true + //this.padjt= + }else{ + this.padHw=false + } if(sessionStorage.getItem('refresh') === 'true') { sessionStorage.removeItem('refresh'); location.reload(); @@ -263,15 +270,15 @@ export class BuildingTypeTwoReverseComponent implements OnInit { title: { text: this.headname+this.tabledata[0].totalCount, left: "center", - //top: "12", - bottom: '510', + top:this.padHw?"18":"0", + bottom:this.padHw?"0":'510', textStyle: { fontSize: 30 } }, grid: { top: 90, - bottom: 30 + bottom: 30, }, xAxis: { id:this.organizationId,