import { stationurl,brigade } from "../../../../public/js/url.js"; import { stationGradeArr } from "../index.js"; import { getGradeValue } from "./getBoroughGrade.js"; var sManage_box_echart=null; function getStationGrade(){ var data={ "brigade":brigade } var loginurl=stationurl+"/firectrl/client/statistics/stations_last_list"; return axios({ method: 'post', url:loginurl, data: data }) } function showStationGrade(){ var data=[ { value: 0, name: '五星校园',scope:5 }, { value: 0, name: '四星校园',scope:4 }, { value: 0, name: '三星校园',scope:3 }, { value: 0, name: '二星校园',scope:2 }, { value: 0, name: '一星校园',scope:1 } ]; for(var i=0;i { let total = 0 // 总数,用来计算百分比 let number = 0 // 数字 let pec = 0 // 百分比 for (let i = 0; i < data.length; i++) { total += data[i].value } for (let i = 0; i < data.length; i++) { if (data[i].name == name) { number = data[i].value pec = (number / total * 100).toFixed(2) } } return [ `${name}`, `${number} (${pec})%`, ].join("\n"); } }, title: { // 用title显示环中间固定的文字 text: stationGradeArr.length, // \n 换行 subtext: '校园数量', // 子标题 top: '40%', left: '24%', textAlign: 'center', // 字体居中对齐 textStyle: { color: '#fff', fontSize:24, lineHeight:10, fontWeight: 'normal', }, subtextStyle: { // 子标题样式 color: '#fff', fontSize: 14, fontFamily: 'myRegular' } }, series: [ { type: 'pie', radius: ['70%', '90%'], center: ['25%', '55%'], // 环形图中心点 label: { show: false, }, data: data } ] } threeColorTotalEchat = echarts.init(document.getElementById('threeColorTotalEchat')); //使用制定的配置项和数据显示图表 threeColorTotalEchat.setOption(option); } export { getStationGrade, showStationGrade, policeManageScopeChart }