robin-gerling opened a new pull request, #19534: URL: https://github.com/apache/echarts/pull/19534
Follow-up of https://github.com/apache/echarts/pull/16825 and https://github.com/apache/echarts/pull/12236 <!-- Please fill in the following information to help us review your PR more efficiently. --> ## Brief Information This pull request is in the type of: - [x] bug fixing - [ ] new feature - [ ] others ### What does this PR do? <!-- USE ONE SENTENCE TO DESCRIBE WHAT THIS PR DOES. --> This PR shrinks the grid size such that the axis labels and names are completely contained (Option (B) of https://github.com/apache/echarts/issues/9265#issuecomment-434022070). ### Fixed issues <!-- - #xxxx: .... --> - #9265: xAxis.nameGap and yAxis.nameGap should be set automatically given grid.containLabel ## Details ### Before: What was the problem? <!-- DESCRIBE THE BUG OR REQUIREMENT HERE. --> When `grid.containLabel` is set to true, the axis names overlap with the labels, when there is no magical number for `nameGap` specified. Furthermore, the names may be not visible when specifying the `nameGap`, because the names get pushed out of the grid. Therefore, also the distance between the grid and the container needs to be adjusted. <!-- ADD SCREENSHOT HERE IF APPLICABLE. --> <img width="782" alt="before" src="https://github.com/apache/echarts/assets/75605520/c366ee9d-48d5-418c-a3fe-72f5dc2a027f"> ### After: How does it behave after the fixing? <!-- THE RESULT AFTER FIXING AND A SIMPLE EXPLANATION ABOUT HOW IT IS FIXED. --> When `grid.containLabel` is set to true, the axis names do not overlap with labels and the grid size is shrinked such that the names are completely visible without the need to specify the grid to container distance or `nameGap`. <!-- ADD SCREENSHOT HERE IF APPLICABLE. --> <img width="782" alt="After" src="https://github.com/apache/echarts/assets/75605520/464ab617-6961-4b95-87d1-498295d4ec2b"> ## Document Info One of the following should be checked. - [ ] This PR doesn't relate to document changes - [x] The document should be updated later - [ ] The document changes have been made in apache/echarts-doc#xxx ## Misc ### ZRender Changes - [ ] This PR depends on ZRender changes (ecomfe/zrender#xxx). ### Related test cases or examples to use the new APIs N.A. ## Others ### Merging options - [ ] Please squash the commits into a single one when merging. ### Other information -- 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]
