Commit 55c2ca2f authored by 耿迪迪's avatar 耿迪迪
parents 366b1d5d d9246893
<template style="">
<div class="pie" style="width:100%;height: 700px;">
<div id="pie1" style="float:left;width:40%;height: 500px;">
<div id="pie1" style="float:left;width:50%;height: 500px;">
<!-- 为 ECharts 准备一个具备大小(宽高)的 DOM -->
<div id="main1" style="width:500px;height:500px;"></div>
<div id="main1" style="width:700px;height:500px;"></div>
</div>
<div id="pie2" style="float:right;width:50%;height: 500px;">
<div id="main2" style="width:650px;height:500px;"></div>
<div id="pie2" style="float:right;width:40%;height: 500px;">
<div id="main2" style="width:550px;height:500px;"></div>
</div>
</div>
</template>
......@@ -37,16 +37,18 @@ export default {
var getData2 = [];
METHOD.axiosGet(
this,
`/enterpriseGoods/getNumberByEnterprise`,
`/enterpriseInfo/getNumberByRegulation`,
function(res) {
if (res.code === 0) {
//先进行赋值
for(let i=0; i<res.data.result.length; i++) {
var obj = new Object();
var arr = new Object();
obj.name = res.data.result[i].name;
// obj.name = res.data.result[i].name;
// obj.value = res.data.result[i].number;
obj.name = res.data.result[i].type;
obj.value = res.data.result[i].number;
arr = res.data.result[i].name;
arr = res.data.result[i].type;
getData1[i] = obj;
getData2[i] = arr;
}
......@@ -67,6 +69,9 @@ export default {
text: '企业按监管分类统计',//主标题
// subtext: '饼状图',//副标题
x:'center',//x轴方向对齐方式
textStyle: {
color: "#fff",
}
},
tooltip : {
trigger: 'item',
......@@ -77,6 +82,9 @@ export default {
right: 'right',
// data: ['探测器','二氧化碳报警器','水压探测器','有毒气体报警器','搜索引擎']
data: [],
textStyle: { //图例文字的样式
color: '#fff',
}
},
series : [
{
......@@ -105,15 +113,17 @@ export default {
var getData2 = [];
METHOD.axiosGet(
this,
`/enterpriseInfo/getNumberByRegulation`,
`/enterpriseGoods/getNumberByEnterprise`,
function(res) {
if (res.code === 0) {
//先进行赋值
for(let i=0; i<res.data.result.length; i++) {
var obj = new Object();
var arr = new Object();
// obj = res.data.result[i].number;
// arr = res.data.result[i].type;
obj = res.data.result[i].number;
arr = res.data.result[i].type;
arr = res.data.result[i].name;
getData1[i] = obj;
getData2[i] = arr;
}
......@@ -132,11 +142,18 @@ export default {
// color:['rgb(8,252,7)','rgb(255,168,0)','rgb(0,121,254)','rgb(0,255,251)','rgb(3,120,251)','rgb(0,200,251)'],
title: {
text: '企业危险源数量统计',//主标题
color: '#fff',
// subtext: '柱状图',
textStyle: {
color: "#fff",
}
},
tooltip: {},
legend: {
data:['危险源']
data:['危险源'],
textStyle: { //图例文字的样式
color: '#fff',
}
},
xAxis: {
axisLabel: {
......@@ -153,7 +170,10 @@ export default {
// data: [5, 20, 36, 10, 10, 20],
data: [],
}],
textStyle: {
color: "#fff",
fontSize: 18
},
});
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment