@@ -1471,27 +1471,19 @@ export class VChart implements IVChart {
14711471 // 处理 specTheme 和 optionTheme, merge -> transform
14721472 // 优先级 currentTheme < optionTheme < specTheme
14731473 if ( ! isEmpty ( optionTheme ) || ! isEmpty ( specTheme ) ) {
1474- if (
1475- ( isString ( optionTheme ) && ( ! specTheme || isString ( specTheme ) ) ) ||
1476- ( isString ( specTheme ) && ( ! optionTheme || isString ( optionTheme ) ) )
1477- ) {
1478- const finalTheme = mergeTheme (
1479- { } ,
1480- getThemeObject ( this . _currentThemeName ) ,
1481- getThemeObject ( optionTheme ) ,
1482- getThemeObject ( specTheme )
1483- ) ;
1484-
1485- this . _currentTheme = processThemeByChartType ( chartType , finalTheme ) ;
1486- } else {
1487- const finalTheme = mergeTheme (
1488- { } ,
1489- getThemeObject ( this . _currentThemeName ) ,
1490- getThemeObject ( optionTheme ) ,
1491- getThemeObject ( specTheme )
1492- ) ;
1493- this . _currentTheme = processThemeByChartType ( chartType , finalTheme ) ;
1494- }
1474+ const finalTheme = mergeTheme (
1475+ { } ,
1476+ getThemeObject (
1477+ isObject ( specTheme ) && specTheme . type
1478+ ? specTheme . type
1479+ : isObject ( optionTheme ) && optionTheme . type
1480+ ? optionTheme . type
1481+ : this . _currentThemeName
1482+ ) ,
1483+ getThemeObject ( optionTheme ) ,
1484+ getThemeObject ( specTheme )
1485+ ) ;
1486+ this . _currentTheme = processThemeByChartType ( chartType , finalTheme ) ;
14951487 } else {
14961488 currentTheme = getThemeObject ( this . _currentThemeName ) ;
14971489 this . _currentTheme = processThemeByChartType ( chartType , currentTheme ) ;
0 commit comments