feat: 初始化图表整体流程

This commit is contained in:
奔跑的面条
2024-12-15 12:48:36 +08:00
parent 0972ea0e28
commit 6106a8fc5c
21 changed files with 381 additions and 28 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ export const mergeTheme = <T, U>(option: T, themeSetting: U, includes: string[])
* @param option
* @return option
*/
export const echartOptionProfixHandle = (option: any, includes: string[]) => {
export const echartOptionProfixHandle = (option: any, includes: string[] = []) => {
option['backgroundColor'] = 'rgba(0,0,0,0)'
return mergeTheme(option, globalThemeJson, includes)
}
+24
View File
@@ -0,0 +1,24 @@
import merge from 'lodash/merge'
import pick from 'lodash/pick'
import { vChartGlobalThemeJson } from '@/settings/vchartThemes/index'
/**
* * 合并 color 和全局配置项
* @param option 配置
* @param themeSetting 设置
* @param excludes 排除元素
* @returns object
*/
export const mergeTheme = <T, U>(option: T, themeSetting: U, includes: string[]) => {
return (option = merge({}, pick(themeSetting, includes), option))
}
/**
* * vCharts option 统一前置处理
* @param option
* @return option
*/
export const vChartOptionPrefixHandle = (option: any, includes: string[] = []) => {
option['background'] = 'rgba(0,0,0,0)'
return mergeTheme(option, vChartGlobalThemeJson, includes)
}