|
|
@@ -9,9 +9,11 @@ import { useBreakpoint } from '/@/hooks/event/useBreakpoint';
|
|
|
import echarts from '/@/utils/lib/echarts';
|
|
|
import { useRootSetting } from '/@/hooks/setting/useRootSetting';
|
|
|
|
|
|
-export function useECharts(elRef: Ref<HTMLDivElement>, theme: 'light' | 'dark' | 'default' = 'default') {
|
|
|
- console.log("---useECharts---初始化加载---")
|
|
|
-
|
|
|
+export function useECharts(
|
|
|
+ elRef: Ref<HTMLDivElement>,
|
|
|
+ theme: 'light' | 'dark' | 'default' = 'default',
|
|
|
+ opt: echarts.EChartsInitOpts = { renderer: 'svg' }
|
|
|
+) {
|
|
|
const { getDarkMode: getSysDarkMode } = useRootSetting();
|
|
|
|
|
|
const getDarkMode = computed(() => {
|
|
|
@@ -40,7 +42,7 @@ export function useECharts(elRef: Ref<HTMLDivElement>, theme: 'light' | 'dark' |
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- chartInstance = echarts.init(el, t, );
|
|
|
+ chartInstance = echarts.init(el, t, opt);
|
|
|
const { removeEvent } = useEventListener({
|
|
|
el: window,
|
|
|
name: 'resize',
|