Adamatoma commented on issue #14252:
URL: https://github.com/apache/echarts/issues/14252#issuecomment-2097407087

   Hi everyone, 
   I found a proper way after looked through all the issues and solutions refer 
to the "legend overlap element" problems.
   This solution leads to an ideal direction: 
https://github.com/lightdash/lightdash/issues/541#issuecomment-1157815376
   And here's my final version:
   ```
   const [legendHeight, setLegendHeight] = useState(0);
   useDebounceEffect(
       () => {
           if (chartRef.current) {
               // @ts-ignore
               const found = chartRef.current._componentsViews.find((entry: 
any) => entry.type === 'legend.plain');
               const myLegendHeight = found?._backgroundEl.shape.height;
               chartRef.current.setOption({
                   grid: {top: myLegendHeight},
               });
           }
       },
       [window_size.width],
       {wait: 200}
   );
   ```
   
   Cheers!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to