This commit is contained in:
lnn19986213 2024-04-17 13:45:32 +08:00
parent f5322a01c3
commit 626deb9ccc
2 changed files with 76 additions and 65 deletions

View File

@ -9,48 +9,94 @@ import * as echarts from "echarts";
const chart = ref(); // DOM const chart = ref(); // DOM
var colors = [
'#0278e6',
'#34d160',
'#fcdf39',
'#f19611',
'#00c6ff',
'#f76363'
]
var data = [ var data = [
{ {
name: '农业专业合作社', name: '正常',
value: 7 value: 17
}, },
{ {
name: '农业企业', name: '关注',
value: 6 value: 16
}, },
{ {
name: '农业冷藏冷库', name: '追踪',
value: 14 value: 14
}, },
{ {
name: '农业园区', name: '异常',
value: 4 value: 8
},
{
name: '警戒',
value: 8
} }
]; ];
let option = { let option = {
color: colors,
legend: {
orient: 'vertical',
top: 'center',
right: '6%',
icon: "circle",
itemGap: 20,
itemWidth: 10,
itemHeight: 10,
textStyle: {
color: '#fff',
fontSize: 18
},
formatter: function (name) {
var target;
for (var i = 0, l = data.length; i < l; i++) {
if (data[i].name == name) {
target = data[i].value;
}
}
return ` ${name} ${target} `;
},
},
tooltip: {
trigger: 'item',
formatter: '{a} <br/>{b} : {c} ({d}%)'
},
series: [ series: [
/*内心原型图,展示整体数据概览*/
{
name: '测评分析',
type: 'pie',
radius: ['20%', '70%'],
center: ['30%', '50%'],
roseType: 'radius',
minShowLabelAngle: 30,
label: {
show: false,
},
data: data
},
// //
{ {
type: "pie", type: "pie",
center: ["50%", "50%"], center: ["30%", "50%"],
radius: ["20%", "32%"], radius: ["20%", "26%"],
hoverAnimation: false, hoverAnimation: false,
clockWise: false, clockWise: false,
itemStyle: { itemStyle: {
normal: { normal: {
borderWidth: 1, borderWidth: 1,
borderColor: "rgba(193, 229, 255, .1)", borderColor: "rgba(193, 229, 255, .1)",
color: new echarts.graphic.LinearGradient(1, 1, 1, 0, [ color: 'rgba(14, 59, 123, 0.60)'
{
offset: 1,
color: "rgba(127, 242, 255, .2)",
},
{
offset: 0,
color: "rgba(109, 195, 255, 0)",
},
]),
}, },
}, },
tooltip: { tooltip: {
@ -61,39 +107,6 @@ let option = {
}, },
data: [100], data: [100],
}, },
/*内心原型图,展示整体数据概览*/
{
name: '半径模式',
type: 'pie',
radius: ['20%', '50%'],
center: ['35%', '50%'],
roseType: 'radius',
minShowLabelAngle: 60,
label: {
show: true,
normal: {
position: 'outside',
fontSize: 16,
formatter: (params) => {
return (
params.name +
// '(' +
// ((params.value / total) * 100).toFixed(2) +
// '%)' +
// '\n' +
params.value +
'个'
);
}
}
},
labelLine: {
length: 1,
length2: 10,
smooth: true
},
data: data
}
] ]
}; };

View File

@ -14,7 +14,7 @@
<div class="yd_title left_2"></div> <div class="yd_title left_2"></div>
<div class="selectLint"> <div class="selectLint">
<div class="selectBox"> <div class="selectBox">
<el-select v-model="value" placeholder="Select" size="large"> <el-select v-model="value" placeholder="Select" size="large" class="selClass">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" /> <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
</el-select> </el-select>
</div> </div>
@ -410,9 +410,9 @@ const options = [
.selectBox { .selectBox {
width: 48%; width: 48%;
background-image: url(@/assets/eduImg/title3.png); background-image: url(@/assets/eduImg/jyImg7.png);
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
} }
} }
</style> </style>
@ -421,22 +421,20 @@ const options = [
.el-select--large .el-select__wrapper { .el-select--large .el-select__wrapper {
font-size: 18px !important; font-size: 18px !important;
} }
.el-select__wrapper { .el-select__wrapper {
background-color: rgba(255,255,255,0) !important; background-color: rgba(255, 255, 255, 0) !important;
} }
.el-select__placeholder{
.el-select__placeholder {
color: #fff !important; color: #fff !important;
} }
.el-select__caret{
.el-select__caret {
color: #fff !important; color: #fff !important;
font-size: 18px !important; font-size: 18px !important;
} }
.el-select-dropdown__item{
color: #fff !important;
}
.el-select-dropdown__wrap{
}
} }
</style> </style>