mirror of
https://gitee.com/dromara/go-view.git
synced 2026-05-12 00:00:01 +08:00
feat: 支持渐变色全局变换
This commit is contained in:
@@ -46,7 +46,7 @@ export const option = {
|
||||
globalCoord: false // 缺省为 false
|
||||
},
|
||||
shadowColor: 'rgba(68, 181, 226, 0.3)',
|
||||
shadowBlur: 5,
|
||||
shadowBlur: 10,
|
||||
shadowOffsetY: 20
|
||||
},
|
||||
data: [120, 200, 150, 80, 70, 110, 130]
|
||||
|
||||
@@ -47,10 +47,17 @@ watchEffect(()=> {
|
||||
})
|
||||
|
||||
// 渐变色处理
|
||||
watch(()=>chartEditStore.getEditCanvasConfig.chartThemeColor, (newColor: string) => {
|
||||
const themeColor = (chartColorsSearch as any)[newColor] || chartColorsSearch[defaultTheme]
|
||||
props.chartConfig.option.series[0].lineStyle.color.colorStops[0].color = themeColor[0]
|
||||
props.chartConfig.option.series[0].lineStyle.color.colorStops[1].color = themeColor[1]
|
||||
option.options = mergeTheme(props.chartConfig.option, props.themeSetting, includes)
|
||||
})
|
||||
</script>
|
||||
watch(()=>chartEditStore.getEditCanvasConfig.chartThemeColor, (newColor: keyof typeof chartColorsSearch) => {
|
||||
const themeColor = chartColorsSearch[newColor] || chartColorsSearch[defaultTheme]
|
||||
props.chartConfig.option.series.forEach((value: any) => {
|
||||
value.lineStyle.shadowColor = themeColor[2]
|
||||
value.lineStyle.color.colorStops.forEach((v: {color: string}, i:number) => {
|
||||
v.color = themeColor[i]
|
||||
})
|
||||
})
|
||||
option.options = mergeTheme(props.chartConfig.option, props.themeSetting, includes)
|
||||
},
|
||||
{
|
||||
immediate: true
|
||||
})
|
||||
</script>
|
||||
Reference in New Issue
Block a user