From abd7688abea2ab295930700fb146b0594e41ac17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E7=88=B1=E5=AD=A6=E4=B9=A0=E7=9A=84=E7=9F=B3?= =?UTF-8?q?=E5=90=8C=E5=AD=A6?= <2936013465@qq.com> Date: Sat, 16 Nov 2024 14:25:48 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E5=A4=A7=E5=B1=8F=E5=89=8D?= =?UTF-8?q?=E7=AB=AF=E6=95=B0=E6=8D=AE=E5=AF=B9=E9=BD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/datav/chart-bar.vue | 9 +++------ src/views/datav/Gobal.vue | 15 +++++++++------ src/views/datav/SceneInsp.vue | 13 +++++++------ 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/src/components/datav/chart-bar.vue b/src/components/datav/chart-bar.vue index f2de06c..6387520 100644 --- a/src/components/datav/chart-bar.vue +++ b/src/components/datav/chart-bar.vue @@ -100,16 +100,13 @@ function getColor(val) { const colors = [...props.color]; colors.sort((a, b) => b.percentage - a.percentage); for (let i = 0; i < colors.length; i++) { - if (val > colors[0].percentage) { - return colors[0].color; + if (val > colors[i].percentage) { + return colors[i].color; } } } return "linear-gradient(270deg, #63e700 0%, #19674c 100%)"; - // if (val >= 0.7) { - // return "linear-gradient( 270deg, #FFB90E 0%, #71501D 100%)"; - // } - // return "linear-gradient( 270deg, #FB002D 0%, #822232 100%)"; + }