ZeRego commented on issue #15654:
URL: https://github.com/apache/echarts/issues/15654#issuecomment-1157807935

   In my case I want the legend at the top to not overflow the grid.
   
   ![Screenshot 2021-10-04 at 17 44 
38](https://user-images.githubusercontent.com/9117144/135892129-4ddd384a-e83d-461b-8c9d-854ad2602f6c.png)
   
   The solution from @Houstoten didn't work for me as accessing anything from 
the `_componentsMap` was always returning undefined. 
   
   I was able to come up with this hack:
   ```
   const found = echartsInstance._componentsViews.find((entry) => entry.type 
=== 'legend.plain');
   const legendHeight = found._backgroundEl.shape.height;
   if (legendHeight) {
       echartsInstance.setOption({
            grid: {
                top: legendHeight + 20,
            },
       });
   }
   ```
   
   @Ovilia I saw some of your comments in other related issues about you having 
internal discussing on how to solve this. Are there any updates on this ? 
   


-- 
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