You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2022/06/16 15:37:33 UTC

[GitHub] [echarts] ZeRego commented on issue #15654: Prevent overlapping elements

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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org