|
@@ -11,9 +11,13 @@ import { useRootSetting } from '/@/hooks/setting/useRootSetting';
|
|
|
|
|
|
export function useECharts(
|
|
|
elRef: Ref<HTMLDivElement>,
|
|
|
- theme: 'light' | 'dark' | 'default' = 'light'
|
|
|
+ theme: 'light' | 'dark' | 'default' = 'default'
|
|
|
) {
|
|
|
- const { getDarkMode } = useRootSetting();
|
|
|
+ const { getDarkMode: getSysDarkMode } = useRootSetting();
|
|
|
+
|
|
|
+ const getDarkMode = computed(() => {
|
|
|
+ return theme === 'default' ? getSysDarkMode.value : theme;
|
|
|
+ });
|
|
|
let chartInstance: echarts.ECharts | null = null;
|
|
|
let resizeFn: Fn = resize;
|
|
|
const cacheOptions = ref({}) as Ref<EChartsOption>;
|