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