diff --git a/src/hooks/useEcharts.ts b/src/hooks/useEcharts.ts index 16b505b2..01f7d7ed 100644 --- a/src/hooks/useEcharts.ts +++ b/src/hooks/useEcharts.ts @@ -79,7 +79,11 @@ export function useECharts( if (!el || !unref(el)) { return; } + const { width, height } = el.getBoundingClientRect(); + if (!width || !height) { + return; + } chartInstance = echarts.init(el, t); const { removeEvent } = useEventListener({ el: window,