fix(图表): 修复透明度在渐变状态下仅对上半部分起作用 #14761

This commit is contained in:
wisonic
2025-03-05 16:43:27 +08:00
committed by wisonic-s
parent ff7e3b1b26
commit 44979e710f

View File

@@ -900,7 +900,9 @@ export function getLineDash(type) {
*/
export function setGradientColor(rawColor: string, show = false, angle = 0, start = 0) {
const item = rawColor.split(',')
item.splice(3, 1, '0.3)')
const alpha = parseFloat(item[3].replace(')', ''))
const startAlpha = alpha * 0.3
item.splice(3, 1, `${startAlpha})`)
let color: string
if (start == 0) {
color = `l(${angle}) 0:${item.join(',')} 1:${rawColor}`