|
|
@ -16,7 +16,7 @@ export class EchartsComponent implements OnInit { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
zhutu; //柱状图实例
|
|
|
|
zhutu; //柱状图实例
|
|
|
|
zhiNameData = { |
|
|
|
zhiData = { |
|
|
|
name: [ |
|
|
|
name: [ |
|
|
|
"南宁支队", |
|
|
|
"南宁支队", |
|
|
|
"柳州支队", |
|
|
|
"柳州支队", |
|
|
@ -37,7 +37,28 @@ export class EchartsComponent implements OnInit { |
|
|
|
number:[180, 170, 140, 140, 120, 110, 150, 130, 120, 160, 160, 130, 180, 170, 120] |
|
|
|
number:[180, 170, 140, 140, 120, 110, 150, 130, 120, 160, 160, 130, 180, 170, 120] |
|
|
|
|
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|
daNameData = { |
|
|
|
zhiData2 = { |
|
|
|
|
|
|
|
name: [ |
|
|
|
|
|
|
|
"南宁支队", |
|
|
|
|
|
|
|
"柳州支队", |
|
|
|
|
|
|
|
"桂林支队", |
|
|
|
|
|
|
|
"梧州支队", |
|
|
|
|
|
|
|
"北海支队", |
|
|
|
|
|
|
|
"防尘岗支队", |
|
|
|
|
|
|
|
"钦州支队", |
|
|
|
|
|
|
|
"贵港支队", |
|
|
|
|
|
|
|
"玉林支队", |
|
|
|
|
|
|
|
"百色支队", |
|
|
|
|
|
|
|
"贺州支队", |
|
|
|
|
|
|
|
"河池支队", |
|
|
|
|
|
|
|
"来宾支队", |
|
|
|
|
|
|
|
"崇左支队", |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
frequency: [18, 17, 14, 14, 12, 11, 15, 13, 12, 16, 16, 13, 18, 17, 12], |
|
|
|
|
|
|
|
number:[180, 170, 140, 140, 120, 110, 150, 130, 120, 160, 160, 130, 180, 170, 120] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
daData = { |
|
|
|
name: [ |
|
|
|
name: [ |
|
|
|
"青秀大队", |
|
|
|
"青秀大队", |
|
|
|
"特勤大队", |
|
|
|
"特勤大队", |
|
|
@ -60,7 +81,7 @@ export class EchartsComponent implements OnInit { |
|
|
|
number: [30, 30, 10, 10, 20, 10, 0, 10, 10, 0, 20, 0, 0, 10, 0], |
|
|
|
number: [30, 30, 10, 10, 20, 10, 0, 10, 10, 0, 20, 0, 0, 10, 0], |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
jiuNameData = { |
|
|
|
jiuData = { |
|
|
|
name:[ |
|
|
|
name:[ |
|
|
|
"南宁市青秀区仙葫消防救援站", |
|
|
|
"南宁市青秀区仙葫消防救援站", |
|
|
|
"南宁市青秀区凤岭消防救援站", |
|
|
|
"南宁市青秀区凤岭消防救援站", |
|
|
@ -98,8 +119,20 @@ export class EchartsComponent implements OnInit { |
|
|
|
} |
|
|
|
} |
|
|
|
this.initCharts(); |
|
|
|
this.initCharts(); |
|
|
|
} |
|
|
|
} |
|
|
|
//点击柱状图
|
|
|
|
//后退
|
|
|
|
|
|
|
|
level=0 |
|
|
|
|
|
|
|
back(){ |
|
|
|
|
|
|
|
if(this.level!=0){ |
|
|
|
|
|
|
|
if(this.level==1){ |
|
|
|
|
|
|
|
this.zhiData=this.zhiData2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
this.zhiData=this.daData |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.initCharts() |
|
|
|
|
|
|
|
this.level=this.level-1 |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
initCharts() { |
|
|
|
initCharts() { |
|
|
|
var detailPlanEchart = echarts.init(document.getElementById("zhidui")); |
|
|
|
var detailPlanEchart = echarts.init(document.getElementById("zhidui")); |
|
|
|
var option = { |
|
|
|
var option = { |
|
|
@ -114,7 +147,7 @@ export class EchartsComponent implements OnInit { |
|
|
|
}, |
|
|
|
}, |
|
|
|
xAxis: { |
|
|
|
xAxis: { |
|
|
|
type: "category", |
|
|
|
type: "category", |
|
|
|
data: this.zhiNameData.name, |
|
|
|
data: this.zhiData.name, |
|
|
|
axisLabel: { |
|
|
|
axisLabel: { |
|
|
|
fontSize: 12, |
|
|
|
fontSize: 12, |
|
|
|
lineHeight: 31, |
|
|
|
lineHeight: 31, |
|
|
@ -150,9 +183,15 @@ export class EchartsComponent implements OnInit { |
|
|
|
}, |
|
|
|
}, |
|
|
|
show: true, |
|
|
|
show: true, |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
grid: {
|
|
|
|
|
|
|
|
left: '5%',
|
|
|
|
|
|
|
|
right: '5%',
|
|
|
|
|
|
|
|
bottom: '1%',
|
|
|
|
|
|
|
|
containLabel: true
|
|
|
|
|
|
|
|
} ,
|
|
|
|
series: [ |
|
|
|
series: [ |
|
|
|
{ |
|
|
|
{ |
|
|
|
data: this.examinationIndex?this.zhiNameData.number: this.zhiNameData.frequency, |
|
|
|
data: this.examinationIndex?this.zhiData.number: this.zhiData.frequency, |
|
|
|
type: "bar", |
|
|
|
type: "bar", |
|
|
|
// showBackground: true,
|
|
|
|
// showBackground: true,
|
|
|
|
backgroundStyle: { |
|
|
|
backgroundStyle: { |
|
|
@ -187,10 +226,12 @@ export class EchartsComponent implements OnInit { |
|
|
|
console.log(e); |
|
|
|
console.log(e); |
|
|
|
|
|
|
|
|
|
|
|
if (e.name.indexOf("支队") != -1) { |
|
|
|
if (e.name.indexOf("支队") != -1) { |
|
|
|
this.zhiNameData = this.daNameData; |
|
|
|
this.zhiData = this.daData; |
|
|
|
|
|
|
|
this.level=1 |
|
|
|
this.initCharts(); |
|
|
|
this.initCharts(); |
|
|
|
} else if (e.name.indexOf("大队") != -1) { |
|
|
|
} else if (e.name.indexOf("大队") != -1) { |
|
|
|
this.zhiNameData = this.jiuNameData; |
|
|
|
this.zhiData = this.jiuData; |
|
|
|
|
|
|
|
this.level=2 |
|
|
|
this.initCharts(); |
|
|
|
this.initCharts(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.router.navigate(["home/statistic-capacity"]); |
|
|
|
this.router.navigate(["home/statistic-capacity"]); |
|
|
|