From 244e94ab95621291cac2acf646614214c2297028 Mon Sep 17 00:00:00 2001 From: ljx <864490211@qq.com> Date: Thu, 17 Apr 2025 12:27:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/baozuo-demo2/CenterCmp.vue | 8 ++++---- src/components/baozuo-demo2/pieChart.vue | 14 ++++++++------ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/components/baozuo-demo2/CenterCmp.vue b/src/components/baozuo-demo2/CenterCmp.vue index aea7f7d..4948cdf 100644 --- a/src/components/baozuo-demo2/CenterCmp.vue +++ b/src/components/baozuo-demo2/CenterCmp.vue @@ -301,7 +301,7 @@ export default { { name: '合格率目标', type: 'line', - data: [98, 98, 98, 98, 98, 98,98], + data: [98, 98, 98, 98, 97, 96,95], symbolSize: 10, itemStyle: { color: '#FFA500' // 橙色折线 @@ -375,7 +375,7 @@ export default { detail: { fontSize: 24, offsetCenter: [0, '-10%'], - color: '#fff', + color: value < 90 ? '#FF0000' : '#fff', // 低于90显示红色,否则白色 formatter: '{value}%' }, data: [{ value }] @@ -470,14 +470,14 @@ export default { justify-content: center; .inspection-title { - font-size: 28px; + font-size: 30px; color: #fff; font-weight: bold; margin-bottom: 10px; } .inspection-value { - font-size: 40px; + font-size: 44px; color: #08e5ff; font-weight: bold; } diff --git a/src/components/baozuo-demo2/pieChart.vue b/src/components/baozuo-demo2/pieChart.vue index 73f5fd2..9ee68e3 100644 --- a/src/components/baozuo-demo2/pieChart.vue +++ b/src/components/baozuo-demo2/pieChart.vue @@ -66,8 +66,6 @@ }, ]; - const colorList = ['#3de7c9','#88a8f4','#FFD700','#08e5ff', '#FF69B4', '#9370DB']; - const sum = chartData.reduce((per, cur) => per + cur.value, 0); var myChart = echarts.init(document.getElementById('pieId-new')); this.option = { @@ -109,25 +107,29 @@ }, series: [{ type: 'radar', + colorBy: 'data', // 添加这一行,根据数据值改变颜色 data: [{ value: chartData.map(item => item.value), name: '产量统计', areaStyle: { - color: 'rgba(8, 229, 255, 0.4)' // 修改为浅蓝色#08e5ff + color: 'rgba(8, 229, 255, 0.4)' }, lineStyle: { width: 2, - color: '#08e5ff' // 修改为浅蓝色#08e5ff + color: '#08e5ff' }, symbolSize: 8, + itemStyle: { + color: '#FFFFFF' + }, label: { show: true, formatter: function(params) { return params.value; }, - color: '#fff', + color: '#FFFFFF', fontWeight: 'bold', - fontSize: 20 + fontSize: 24 } }] }]