|
|
|
|
@ -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%)"; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
</script> |
|
|
|
|
<style lang="scss" scoped> |
|
|
|
|
|