From 5d33aecbf433c413174d5153124445646f8d6470 Mon Sep 17 00:00:00 2001 From: xile611 Date: Wed, 11 Mar 2026 11:29:01 +0800 Subject: [PATCH 1/2] fix: fix theme config of spec and option --- packages/vchart/src/core/vchart.ts | 34 ++++++++++++------------------ 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/packages/vchart/src/core/vchart.ts b/packages/vchart/src/core/vchart.ts index b337bf670d..a43fd728fb 100644 --- a/packages/vchart/src/core/vchart.ts +++ b/packages/vchart/src/core/vchart.ts @@ -1471,27 +1471,19 @@ export class VChart implements IVChart { // 处理 specTheme 和 optionTheme, merge -> transform // 优先级 currentTheme < optionTheme < specTheme if (!isEmpty(optionTheme) || !isEmpty(specTheme)) { - if ( - (isString(optionTheme) && (!specTheme || isString(specTheme))) || - (isString(specTheme) && (!optionTheme || isString(optionTheme))) - ) { - const finalTheme = mergeTheme( - {}, - getThemeObject(this._currentThemeName), - getThemeObject(optionTheme), - getThemeObject(specTheme) - ); - - this._currentTheme = processThemeByChartType(chartType, finalTheme); - } else { - const finalTheme = mergeTheme( - {}, - getThemeObject(this._currentThemeName), - getThemeObject(optionTheme), - getThemeObject(specTheme) - ); - this._currentTheme = processThemeByChartType(chartType, finalTheme); - } + const finalTheme = mergeTheme( + {}, + getThemeObject( + isObject(specTheme) && specTheme.type + ? specTheme.type + : isObject(optionTheme) && optionTheme.type + ? optionTheme.type + : this._currentThemeName + ), + getThemeObject(optionTheme), + getThemeObject(specTheme) + ); + this._currentTheme = processThemeByChartType(chartType, finalTheme); } else { currentTheme = getThemeObject(this._currentThemeName); this._currentTheme = processThemeByChartType(chartType, currentTheme); From 7632f9b445df80aecdb5eaccc4e641bd1fccc93f Mon Sep 17 00:00:00 2001 From: xile611 Date: Wed, 11 Mar 2026 11:30:21 +0800 Subject: [PATCH 2/2] docs: update changlog of rush --- .../@visactor/vchart/develop_2026-03-11-03-30.json | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 common/changes/@visactor/vchart/develop_2026-03-11-03-30.json diff --git a/common/changes/@visactor/vchart/develop_2026-03-11-03-30.json b/common/changes/@visactor/vchart/develop_2026-03-11-03-30.json new file mode 100644 index 0000000000..5f5bc535a7 --- /dev/null +++ b/common/changes/@visactor/vchart/develop_2026-03-11-03-30.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "fix: fix theme config of spec and option\n\n", + "type": "none", + "packageName": "@visactor/vchart" + } + ], + "packageName": "@visactor/vchart", + "email": "dingling112@gmail.com" +} \ No newline at end of file