wujingjing
2024-10-16 e5146fb2b0230b9a3c4002290639d69a4bc82467
src/components/chat/chatComponents/hooks/useDrawChatChart.ts
@@ -18,23 +18,28 @@
   const initChart = ()=>{
      setTimeout(() => {
         const instance = echarts.getInstanceByDom(chartRef.value);
         if (!instance) {
         const parent = chartRef.value.parentElement;
         const parentBound = parent.getBoundingClientRect();
         chartInstance.value = echarts.init(chartRef.value, undefined, {
            width: parentBound.width,
            height: parentBound.height,
            locale: 'ZH',
         });
         resizeChart = debounce((width, height) => {
            chartInstance.value.resize({
               width: width,
               height: height,
            });
         });
         }
         drawChart();
      }, 100);
   }
   };
   onMounted(() => {
      initChart();
@@ -43,5 +48,6 @@
   return {
      chartContainerResize,
      chartInstance,
   };
};