You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by "Rohitgiri02 (via GitHub)" <gi...@apache.org> on 2025/11/27 09:08:44 UTC

[PR] fix(grid): respect axisLabel.width when containLabel is true [echarts]

Rohitgiri02 opened a new pull request, #21392:
URL: https://github.com/apache/echarts/pull/21392

   Previously, when grid.containLabel was set to true, the grid layout calculation used the actual text width instead of the configured axisLabel.width, causing incorrect layout when overflow was set to 'truncate'.
   
   This fix checks if axisLabel.width is configured and uses that value for grid layout calculation, ensuring consistent behavior.
   
   Fixes #16111 
   
   ## Brief Information
   
   This pull request is in the type of:
   
   - [x] bug fixing
   - [ ] new feature
   - [ ] others
   
   ### What does this PR do?
   
   Fix grid layout calculation to respect `axisLabel.width` configuration when `grid.containLabel` is enabled and `overflow` is set to `'truncate'`.
   
   ### Fixed issues
   
   - #16111: Grid doesn't respect axisLabel.width when containLabel is true
   
   ## Details
   
   ### Before: What was the problem?
   
   When `grid.containLabel` was set to `true` and `yAxis.axisLabel.width` was configured with `overflow: 'truncate'`, the grid layout calculation incorrectly used the **actual text width** instead of the **configured width value**. This caused the grid to reserve too much space for axis labels, resulting in incorrect chart layout.
   
   **Example of the bug:**
                       // xAxis use proportion on x, yAxis use proprotion on y, otherwise not.
                       fillMarginOnOneDimension(labelInfo.rect, xyIdx, proportion);
                       fillMarginOnOneDimension(labelInfo.rect, 1 - xyIdx, NaN);
   ```
   
   In this case, the grid would reserve space based on the full text width (e.g., 500px) instead of the configured 300px, causing layout issues.
   
   ### After: How does it behave after the fixing?
   
   The grid layout calculation now correctly:
   1. Checks if `axisLabel.width` is configured
   2. Uses the configured width value for grid margin calculation when available
   3. Handles both `string` and `number` types for the width value
   4. Falls back to actual text width when no width is configured
   
   **After the fix:**
   - Grid correctly reserves 300px as configured
   - Layout is consistent with the user's intention
   - Text is properly truncated at the specified width
   
   **Implementation:**
   Modified the `fillLabelNameOverflowOnOneDimension` function in `src/coord/cartesian/Grid.ts` to retrieve the configured `axisLabel.width` and apply it to the label rect before margin calculation.
   
   ## Document Info
   
   One of the following should be checked.
   
   - [x] This PR doesn't relate to document changes
   - [ ] The document should be updated later
   - [ ] The document changes have been made in apache/echarts-doc#xxx
   
   ## Misc
   
   ### Security Checking
   
   - [x] This PR does not use security-sensitive Web APIs.
   
   ### ZRender Changes
   
   - [x] This PR does not depend on ZRender changes.
   
   ### Related test cases or examples to use the new APIs
   
   Manual test case added: `test/bug-16111.html`
   
   This test demonstrates the fix by showing a chart with:
   - `grid.containLabel: true`
   - `yAxis.axisLabel.width: 300`
   - `yAxis.axisLabel.overflow: 'truncate'`
   - Long Chinese text that exceeds 300px
   
   Before the fix, the grid would overflow. After the fix, it correctly respects the 300px width.
   
   ### Merging options
   
   - [x] Please squash the commits into a single one when merging.
   
   ### Other information
   
   This is my first contribution to Apache ECharts. The fix is minimal and focused on the specific issue - it only affects grid layout calculation when both `containLabel: true` and `axisLabel.width` are configured together.
   
   The fix properly handles type conversion from `string | number` to `number` and only applies to y-axis labels (where width is the relevant dimension for horizontal layout).
   


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


Re: [PR] fix(grid): respect axisLabel.width when containLabel is true [echarts]

Posted by "Justin-ZS (via GitHub)" <gi...@apache.org>.
Justin-ZS commented on PR #21392:
URL: https://github.com/apache/echarts/pull/21392#issuecomment-3673029388

   [containLabel](https://echarts.apache.org/examples/zh/editor.html?c=pie-simple&code=TVFNS8NAEL3vr5hbFEJIK6JEPKggCHpqwUPxMEmmyeI2E3Yn_aD4351N2ioku_O1b9684V4sd_AIR9N4Wxd6O1pLAXlqhPvxLlmEN6PJg5B_5qGrwwfXVEAScENJCv8SL9wJ2k5zuLfhHUtyiflJzeFJ3djgEh4dZ5tY623TSpKana2lLeAmj9225NeOd5oWP3QVirYy5JztQ4RKsizTgGIbOfSRTSxp2B80WqNgASsDkCxb8gQ2AELvuXS0gZ2VFqTVWI8eG499m8Ib0L6nSjRB4KhrtIbXUE0DjZRBGEqCEgPVoMKNQ2WXibKRPtguCKEWrEcorGRAfUp70cZaoPSU1ifVk7Fsh8l49XYyFhi1iMbQqfE1Drk_C3gadotuiIJoKpC3pLmVOZ4Hn83zFOYqI8xu9bjX_y46s3jc5Ap5ginRK0hoefeM1Xfj4xILUMFJV3-JLOTgtPpoKnbs48KaEq9mEfbvyLP59URIv0j64Rc&enc=deflate) is deprecated since 6.0
   you can use the new outerBoundsMode to avoid this bug. [demo](https://echarts.apache.org/examples/zh/editor.html?c=pie-simple&code=TVFNS8NAEL3vr5hbFEJIK6JEPKggCHpqwUPxMEmmyeI2E3Yn_aD4351N2ioku_O1b9684V4sd_AIR9N4Wxd6O1pLAXlqhPvxLlmEN6PJg5B_5qGrwwfXVEAScENJCv8SL9wJ2k5zuLfhHUtyiflJzeFJ3djgEh4dZ5tY623TSpKana2lLeAmj9225NeOd5oWP3QVirYy5JztQ4RKsizTgGIbOfSRTSxp2B80WqNgASsDkCxb8gQ2AELvuXS0gZ2VFqTVWI8eG499m8Ib0L6nSjRB4KhrtIbXUE0DjZRBGEqCEgPVoMKNQ2WXibKRPtguCKEWrEcorGRAfUp70cZaoPSU1ifVk7Fsh8l49XYyFhi1iMbQqfE1Drk_C3gadotuiIJoKpC3pLmVOZ4Hn83zFOYqI8xu9bjX_y46s3jc5Ap5ginRK0hoefeM1Xfj4xILUMFJV3-JLOTgtPpoKnbs48KaEq9mEfbvyLP59URIv0j64Rc&enc=deflate)
   From the behavior, the root cause seems to be the wrong text width measurement in the Window sys.


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


Re: [PR] fix(grid): respect axisLabel.width when containLabel is true [echarts]

Posted by "Justin-ZS (via GitHub)" <gi...@apache.org>.
Justin-ZS commented on PR #21392:
URL: https://github.com/apache/echarts/pull/21392#issuecomment-3645143654

   > i tried to reproduce
   > 
   > > I tried the [demo](https://echarts.apache.org/examples/zh/editor.html?c=line-simple&code=TVK7TsMwFN35irsFJBQlRQgUxAADE1uRGBCD25rUwsSV61AqhMQCZYCBgZfEQ0KCjXZCqgqlP9NE7dRfwHZcp0Nu7rk-Pvfhy2qCsAjW4XQOIOSkEmgPgOIDEYC3qIFgNeuXmBDsyMIyiwQi0TYqYRqA4DFW8TNlmhsnpD7VQ9I3pCwgQ5SEUQAOJ2FVOJkcQINURDUA3zMJANgx5geUNSRV6kdlJLBlY0pJra7SOK7rmrDMnpXdrGF5oC6EjDfNaQUJFMCeEXBGg6e0_T3qvCSt3rB3OX5oj98fJ7_X6dVt-vyW_F3Mdji-GyS9z-HPB0wGfd2faxtzdeUw7PaS1uXo_HrYvUkfO5KbtF_HTxfpfSv5ekjafSWgObYJZxdXcrBTjXOwxUkOiigfk1OMIwP27cRPZiduuj9GNM7mpSl1zAmWnKz_6VOYmfgFbxEKcvLgL0uzKr8VBXxlljydaEa6hLitp15ljU1UPgw5iyO5RdNN0Ctj40XRpPLmNK1aH8q42oGwhOZ9lTA3nltYsPq6ePOTdZyt_QM&enc=deflate) in #16111, and it seems to work as expected on my end. Could you provide more details about the issue you're experiencing?
   > 
   > When grid.containLabel was set to true and yAxis.axisLabel.width was configured with overflow: 'truncate', the grid layout calculation incorrectly used the actual text width instead of the configured width value. This caused the grid to reserve too much space for axis labels, resulting in incorrect chart layout.
   > 
   > before the fix <img alt="line-simple (3)" width="1057" height="701" src="https://private-user-images.githubusercontent.com/173557181/525357882-fb3baf4d-d349-40f2-aee2-0af06ec7ed8b.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NjU1MjE3MjEsIm5iZiI6MTc2NTUyMTQyMSwicGF0aCI6Ii8xNzM1NTcxODEvNTI1MzU3ODgyLWZiM2JhZjRkLWQzNDktNDBmMi1hZWUyLTBhZjA2ZWM3ZWQ4Yi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUxMjEyJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MTIxMlQwNjM3MDFaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1jZWE0MmU1NzAzOTgzZDRjYjA1ZTIwZjUzMjkwOTJjYWUxMzIyMDRjZWI2YzI3NzcwZWRjMmJlZjQ2MjY5OWUzJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.et5GPU-2uK4RYb5HtgpwrOjwnbqtmz8nY7iuSZkuC4U"> after the fix you can see the right side of label <img alt="Screenshot 2025-12-11 172348" width="999" height="757" src="https://private-u
 ser-images.githubusercontent.com/173557181/525358111-36490d17-c421-47ac-a6fb-58dae25f5162.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NjU1MjE3MjEsIm5iZiI6MTc2NTUyMTQyMSwicGF0aCI6Ii8xNzM1NTcxODEvNTI1MzU4MTExLTM2NDkwZDE3LWM0MjEtNDdhYy1hNmZiLTU4ZGFlMjVmNTE2Mi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUxMjEyJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MTIxMlQwNjM3MDFaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0yNjYxZTEzMjg2NDg0ZTgwNjQ1NGM4YzcyZDg0YzUxZmE1ZmI2ZTVhNGE3YTU3Y2UwOWRmZjllYzUzMThjYjE4JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.Mq22YSgy4JmdY-ZDIfoJw9cQXjZvMeEXtqu0HoFk-VU">
   
   This caused the grid to reserve **too much space** for axis labels, resulting in incorrect chart layout.
   I can't find any extra blank spaces. Could you add some markers to emphasize the incorrect blank spaces?
   <img width="291" height="194" alt="截屏2025-12-12 14 42 44" src="https://github.com/user-attachments/assets/6f42d3b7-3a14-445f-be58-5daa7f840651" />
   
   
   
   


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


Re: [PR] fix(grid): respect axisLabel.width when containLabel is true [echarts]

Posted by "Rohitgiri02 (via GitHub)" <gi...@apache.org>.
Rohitgiri02 commented on PR #21392:
URL: https://github.com/apache/echarts/pull/21392#issuecomment-3641394232

   > I tried the [demo](https://echarts.apache.org/examples/zh/editor.html?c=line-simple&code=TVK7TsMwFN35irsFJBQlRQgUxAADE1uRGBCD25rUwsSV61AqhMQCZYCBgZfEQ0KCjXZCqgqlP9NE7dRfwHZcp0Nu7rk-Pvfhy2qCsAjW4XQOIOSkEmgPgOIDEYC3qIFgNeuXmBDsyMIyiwQi0TYqYRqA4DFW8TNlmhsnpD7VQ9I3pCwgQ5SEUQAOJ2FVOJkcQINURDUA3zMJANgx5geUNSRV6kdlJLBlY0pJra7SOK7rmrDMnpXdrGF5oC6EjDfNaQUJFMCeEXBGg6e0_T3qvCSt3rB3OX5oj98fJ7_X6dVt-vyW_F3Mdji-GyS9z-HPB0wGfd2faxtzdeUw7PaS1uXo_HrYvUkfO5KbtF_HTxfpfSv5ekjafSWgObYJZxdXcrBTjXOwxUkOiigfk1OMIwP27cRPZiduuj9GNM7mpSl1zAmWnKz_6VOYmfgFbxEKcvLgL0uzKr8VBXxlljydaEa6hLitp15ljU1UPgw5iyO5RdNN0Ctj40XRpPLmNK1aH8q42oGwhOZ9lTA3nltYsPq6ePOTdZyt_QM&enc=deflate) in #16111, and it seems to work as expected on my end. Could you provide more details about the issue you're experiencing?
   <img width="1057" height="701" alt="line-simple (2)" src="https://github.com/user-attachments/assets/18c4bc8e-7441-4a17-979f-32e77c19b772" />
   here you can see that the lable text is not visible completely there is padding issue if Use the option: yAxis with category data containing a long string, axisLabel.width: 300 and overflow: 'truncate', and grid.containLabel: true. The grid will be sized as if the label were its full length


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


Re: [PR] fix(grid): respect axisLabel.width when containLabel is true [echarts]

Posted by "echarts-bot[bot] (via GitHub)" <gi...@apache.org>.
echarts-bot[bot] commented on PR #21392:
URL: https://github.com/apache/echarts/pull/21392#issuecomment-3584848018

   Thanks for your contribution!
   The community will review it ASAP. In the meanwhile, please checkout [the coding standard](https://echarts.apache.org/en/coding-standard.html) and Wiki about [How to make a pull request](https://github.com/apache/echarts/wiki/How-to-make-a-pull-request).
   
   Please **DO NOT** commit the files in [dist](https://github.com/apache/echarts/tree/master/dist), [i18n](https://github.com/apache/echarts/tree/master/i18n), and [ssr/client/dist](https://github.com/apache/echarts/tree/master/ssr/client/dist) folders in a non-release pull request. These folders are for release use only.


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


Re: [PR] fix(grid): respect axisLabel.width when containLabel is true [echarts]

Posted by "Rohitgiri02 (via GitHub)" <gi...@apache.org>.
Rohitgiri02 commented on PR #21392:
URL: https://github.com/apache/echarts/pull/21392#issuecomment-3664627658

   > This issue can only be reproduced on Windows. It works well on Mac Chrome.
   
   thanks for the information. i tried it on windows earlier but this Pr will successfully fix this issue for any type of device and browser


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


Re: [PR] fix(grid): respect axisLabel.width when containLabel is true [echarts]

Posted by "Justin-ZS (via GitHub)" <gi...@apache.org>.
Justin-ZS commented on PR #21392:
URL: https://github.com/apache/echarts/pull/21392#issuecomment-3652773439

   > > ou add some m
   > 
   > you need to change the width to 300px or more to see the extra blank space to reproduce just open the demo and copy paste the code
   > 
   > option = { grid: { left: 0, top: 0, bottom: 0, containLabel: true, }, yAxis: { axisLabel: { align: 'right', width: 300, overflow: 'truncate', ellipsis: '...', },
   > 
   > ```
   > type: 'category',
   > data: [
   >   'There is a problem with this paragraph, I expect the length of containLabel to be based on yAxis.axisLabel.width instead of the actual text width',
   >   'Wed',
   >   'Thu',
   >   'Fri',
   >   'Sat',
   >   'Sun',
   > ],
   > ```
   > 
   > }, xAxis: { type: 'value', }, series: [ { data: [120, 200, 150, 80, 70, 110, 130], type: 'bar', showBackground: true, backgroundStyle: { color: 'rgba(180, 180, 180, 0.2)', }, }, ], };
   > 
   > make sure to copy paste it correctly to see extra blank; <img alt="Screenshot 2025-12-12 155838" width="1858" height="902" src="https://private-user-images.githubusercontent.com/173557181/525834912-490dd013-a991-4311-88cd-31c31d073c1d.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NjU3NzExMjksIm5iZiI6MTc2NTc3MDgyOSwicGF0aCI6Ii8xNzM1NTcxODEvNTI1ODM0OTEyLTQ5MGRkMDEzLWE5OTEtNDMxMS04OGNkLTMxYzMxZDA3M2MxZC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUxMjE1JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MTIxNVQwMzUzNDlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT00OWMzZDAxMzM4M2FhZDQ2NDRiYjcwZGY1YTVhNjE5ODJhNzkzOTY0ZDg1MjU2ZmM1ZTgyYmEwZDYyOTU3MWVlJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.tmkgJRkG5114JlISgPXtyp0BqTxviIPRbmmzAuU6BkQ">
   
   It still looks fine on my side. [demo](https://echarts.apache.org/examples/zh/editor.html?c=pie-simple&code=TVFNa8MwDL3nV-jWDUJIO8ZGxg7bYTDYrYUdyg5KoiZmrh0cpR-U_fc9J203SCRZen7Wk3ynxjt6plPSBFMX8FY2WlCeJuq70Zde1W_HsPJO2bgPLsUWpGGQNPlJk-PLwfTxLsOfizhY07iCZsE0rc7SZG9qbQu6y0HkdxI21u9RBourWAUIsdZ0faSaZVmGBLgTPXaCRIQ0PhyRrVm5oHVCNFu1EoRMT0xd8KWVLe2NtqQtch0HbgJ3bUrvJIdOKkVByIprgPEb-q-H1FMpVHIvNWEmo6jsqigb2yfjehUGYDNScaUD46ocFA8DgPbQ1qfUU7Bqhyl4C2YKlhxnEYPBIfgaRR4uAzyL3bEd4kBQ6iUYQW2dnC7C54s8pQXGSPN7mEf8D_Ewj-YuB-WZpuQAkr71-1euvpvgB4cVT2srr5mlHi3QJ2zX-hAX1pR8M4-0fybPFrdTQ_hi00-_&enc=deflate)
   <img width="1144" height="843" alt="截屏2025-12-15 09 20 18" src="https://github.com/user-attachments/assets/5238bf99-a01c-4d74-be39-55411b6e37aa" />
   
   


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


Re: [PR] fix(grid): respect axisLabel.width when containLabel is true [echarts]

Posted by "Rohitgiri02 (via GitHub)" <gi...@apache.org>.
Rohitgiri02 commented on PR #21392:
URL: https://github.com/apache/echarts/pull/21392#issuecomment-3652809063

   > > > ou add some m
   > > 
   > > 
   > > you need to change the width to 300px or more to see the extra blank space to reproduce just open the demo and copy paste the code
   > > option = { grid: { left: 0, top: 0, bottom: 0, containLabel: true, }, yAxis: { axisLabel: { align: 'right', width: 300, overflow: 'truncate', ellipsis: '...', },
   > > ```
   > > type: 'category',
   > > data: [
   > >   'There is a problem with this paragraph, I expect the length of containLabel to be based on yAxis.axisLabel.width instead of the actual text width',
   > >   'Wed',
   > >   'Thu',
   > >   'Fri',
   > >   'Sat',
   > >   'Sun',
   > > ],
   > > ```
   > > 
   > > 
   > >     
   > >       
   > >     
   > > 
   > >       
   > >     
   > > 
   > >     
   > >   
   > > }, xAxis: { type: 'value', }, series: [ { data: [120, 200, 150, 80, 70, 110, 130], type: 'bar', showBackground: true, backgroundStyle: { color: 'rgba(180, 180, 180, 0.2)', }, }, ], };
   > > make sure to copy paste it correctly to see extra blank; <img alt="Screenshot 2025-12-12 155838" width="1858" height="902" src="https://private-user-images.githubusercontent.com/173557181/525834912-490dd013-a991-4311-88cd-31c31d073c1d.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NjU3NzExMjksIm5iZiI6MTc2NTc3MDgyOSwicGF0aCI6Ii8xNzM1NTcxODEvNTI1ODM0OTEyLTQ5MGRkMDEzLWE5OTEtNDMxMS04OGNkLTMxYzMxZDA3M2MxZC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUxMjE1JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MTIxNVQwMzUzNDlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT00OWMzZDAxMzM4M2FhZDQ2NDRiYjcwZGY1YTVhNjE5ODJhNzkzOTY0ZDg1MjU2ZmM1ZTgyYmEwZDYyOTU3MWVlJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.tmkgJRkG5114JlISgPXtyp0BqTxviIPRbmmzAuU6BkQ">
   > 
   > It still looks fine on my side. [demo](https://echarts.apache.org/examples/zh/editor.html?c=pie-simple&code=TVFNa8MwDL3nV-jWDUJIO8ZGxg7bYTDYrYUdyg5KoiZmrh0cpR-U_fc9J203SCRZen7Wk3ynxjt6plPSBFMX8FY2WlCeJuq70Zde1W_HsPJO2bgPLsUWpGGQNPlJk-PLwfTxLsOfizhY07iCZsE0rc7SZG9qbQu6y0HkdxI21u9RBourWAUIsdZ0faSaZVmGBLgTPXaCRIQ0PhyRrVm5oHVCNFu1EoRMT0xd8KWVLe2NtqQtch0HbgJ3bUrvJIdOKkVByIprgPEb-q-H1FMpVHIvNWEmo6jsqigb2yfjehUGYDNScaUD46ocFA8DgPbQ1qfUU7Bqhyl4C2YKlhxnEYPBIfgaRR4uAzyL3bEd4kBQ6iUYQW2dnC7C54s8pQXGSPN7mEf8D_Ewj-YuB-WZpuQAkr71-1euvpvgB4cVT2srr5mlHi3QJ2zX-hAX1pR8M4-0fybPFrdTQ_hi00-_&enc=deflate) <img alt="截屏2025-12-15 09 20 18" width="1144" height="843" src="https://private-user-images.githubusercontent.com/29063445/526384922-5238bf99-a01c-4d74-be39-55411b6e37aa.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NjU3NzE4MzUsIm5iZiI6MTc2NTc3MTUzNSwicGF0aCI6Ii8yOTA2MzQ0NS81MjYzODQ5MjItNTIzOGJmOTkt
 YTAxYy00ZDc0LWJlMzktNTU0MTFiNmUzN2FhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTEyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUxMjE1VDA0MDUzNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTI1ZGEyNTQwNmJiZDNhZGIwZjZkMDU5NmQxZWU5NGYxZWIzMTIxOThhNWFlNTE5ZDhhM2U2MjQ5MzI2NTcyN2QmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.iWItHcH4NZGepcVakzWBlkJ7XPoAIpVcYZ5AVmthJdA">
   
   i seen the demo on my end there is still issue on my end. i don't know the reason why it different on your end. could you please go through the Pr changes. there you will understand the main logical issue in calculating the y-axis lable width. the logic is simple get the configured lable width and if it is available use it. 


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


Re: [PR] fix(grid): respect axisLabel.width when containLabel is true [echarts]

Posted by "Rohitgiri02 (via GitHub)" <gi...@apache.org>.
Rohitgiri02 commented on PR #21392:
URL: https://github.com/apache/echarts/pull/21392#issuecomment-3693688374

   > [containLabel](https://echarts.apache.org/examples/zh/editor.html?c=pie-simple&code=TVFNS8NAEL3vr5hbFEJIK6JEPKggCHpqwUPxMEmmyeI2E3Yn_aD4351N2ioku_O1b9684V4sd_AIR9N4Wxd6O1pLAXlqhPvxLlmEN6PJg5B_5qGrwwfXVEAScENJCv8SL9wJ2k5zuLfhHUtyiflJzeFJ3djgEh4dZ5tY623TSpKana2lLeAmj9225NeOd5oWP3QVirYy5JztQ4RKsizTgGIbOfSRTSxp2B80WqNgASsDkCxb8gQ2AELvuXS0gZ2VFqTVWI8eG499m8Ib0L6nSjRB4KhrtIbXUE0DjZRBGEqCEgPVoMKNQ2WXibKRPtguCKEWrEcorGRAfUp70cZaoPSU1ifVk7Fsh8l49XYyFhi1iMbQqfE1Drk_C3gadotuiIJoKpC3pLmVOZ4Hn83zFOYqI8xu9bjX_y46s3jc5Ap5ginRK0hoefeM1Xfj4xILUMFJV3-JLOTgtPpoKnbs48KaEq9mEfbvyLP59URIv0j64Rc&enc=deflate) is deprecated since 6.0 you can use the new outerBoundsMode to avoid this bug. [demo](https://echarts.apache.org/examples/zh/editor.html?c=pie-simple&code=TVFNS8NAEL3vr5hbFEJIK6JEPKggCHpqwUPxMEmmyeI2E3Yn_aD4351N2ioku_O1b9684V4sd_AIR9N4Wxd6O1pLAXlqhPvxLlmEN6PJg5B_5qGrwwfXVEAScENJCv8SL9wJ2k5zuLfhHUtyiflJzeFJ3djgEh4dZ5tY623TSpKana2lLeAmj9225NeOd5oWP3QVirYy5JztQ4RKsizTgGIbOfSRTSxp2B80WqNgASsDkCxb8gQ2A
 ELvuXS0gZ2VFqTVWI8eG499m8Ib0L6nSjRB4KhrtIbXUE0DjZRBGEqCEgPVoMKNQ2WXibKRPtguCKEWrEcorGRAfUp70cZaoPSU1ifVk7Fsh8l49XYyFhi1iMbQqfE1Drk_C3gadotuiIJoKpC3pLmVOZ4Hn83zFOYqI8xu9bjX_y46s3jc5Ap5ginRK0hoefeM1Xfj4xILUMFJV3-JLOTgtPpoKnbs48KaEq9mEfbvyLP59URIv0j64Rc&enc=deflate) From the behavior, the root cause seems to be the wrong text width measurement in the Window sys.
   
   thanks for clarification as the package is deprecated. I am closing this PR.
   thanks for the continous discussion [Justin-ZS](https://github.com/Justin-ZS)


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


Re: [PR] fix(grid): respect axisLabel.width when containLabel is true [echarts]

Posted by "Rohitgiri02 (via GitHub)" <gi...@apache.org>.
Rohitgiri02 closed pull request #21392: fix(grid): respect axisLabel.width when containLabel is true
URL: https://github.com/apache/echarts/pull/21392


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


Re: [PR] fix(grid): respect axisLabel.width when containLabel is true [echarts]

Posted by "Justin-ZS (via GitHub)" <gi...@apache.org>.
Justin-ZS commented on PR #21392:
URL: https://github.com/apache/echarts/pull/21392#issuecomment-3641172047

   I tried the [demo](https://echarts.apache.org/examples/zh/editor.html?c=line-simple&code=TVK7TsMwFN35irsFJBQlRQgUxAADE1uRGBCD25rUwsSV61AqhMQCZYCBgZfEQ0KCjXZCqgqlP9NE7dRfwHZcp0Nu7rk-Pvfhy2qCsAjW4XQOIOSkEmgPgOIDEYC3qIFgNeuXmBDsyMIyiwQi0TYqYRqA4DFW8TNlmhsnpD7VQ9I3pCwgQ5SEUQAOJ2FVOJkcQINURDUA3zMJANgx5geUNSRV6kdlJLBlY0pJra7SOK7rmrDMnpXdrGF5oC6EjDfNaQUJFMCeEXBGg6e0_T3qvCSt3rB3OX5oj98fJ7_X6dVt-vyW_F3Mdji-GyS9z-HPB0wGfd2faxtzdeUw7PaS1uXo_HrYvUkfO5KbtF_HTxfpfSv5ekjafSWgObYJZxdXcrBTjXOwxUkOiigfk1OMIwP27cRPZiduuj9GNM7mpSl1zAmWnKz_6VOYmfgFbxEKcvLgL0uzKr8VBXxlljydaEa6hLitp15ljU1UPgw5iyO5RdNN0Ctj40XRpPLmNK1aH8q42oGwhOZ9lTA3nltYsPq6ePOTdZyt_QM&enc=deflate) in https://github.com/apache/echarts/issues/16111, and it seems to work as expected on my end.
   Could you provide more details about the issue you're experiencing?


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


Re: [PR] fix(grid): respect axisLabel.width when containLabel is true [echarts]

Posted by "Rohitgiri02 (via GitHub)" <gi...@apache.org>.
Rohitgiri02 commented on PR #21392:
URL: https://github.com/apache/echarts/pull/21392#issuecomment-3645897933

   > ou add some m
   
   you need to change the width to 300px or more to see the extra blank space to reproduce just open the demo and copy paste the code 
   
   option = {
     grid: {
       left: 0,
       top: 0,
       bottom: 0,
       containLabel: true,
     },
     yAxis: {
       axisLabel: {
         align: 'right',
         width: 300,
         overflow: 'truncate',
         ellipsis: '...',
       },
   
       type: 'category',
       data: [
         'There is a problem with this paragraph, I expect the length of containLabel to be based on yAxis.axisLabel.width instead of the actual text width',
         'Wed',
         'Thu',
         'Fri',
         'Sat',
         'Sun',
       ],
     },
     xAxis: {
       type: 'value',
     },
     series: [
       {
         data: [120, 200, 150, 80, 70, 110, 130],
         type: 'bar',
         showBackground: true,
         backgroundStyle: {
           color: 'rgba(180, 180, 180, 0.2)',
         },
       },
     ],
   };
   
   make sure to copy paste it correctly to see extra blank;
   <img width="1858" height="902" alt="Screenshot 2025-12-12 155838" src="https://github.com/user-attachments/assets/490dd013-a991-4311-88cd-31c31d073c1d" />
   


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


Re: [PR] fix(grid): respect axisLabel.width when containLabel is true [echarts]

Posted by "Justin-ZS (via GitHub)" <gi...@apache.org>.
Justin-ZS commented on PR #21392:
URL: https://github.com/apache/echarts/pull/21392#issuecomment-3659735731

   This issue can only be reproduced on Windows.
   It works well on Mac Chrome.


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


Re: [PR] fix(grid): respect axisLabel.width when containLabel is true [echarts]

Posted by "Rohitgiri02 (via GitHub)" <gi...@apache.org>.
Rohitgiri02 commented on PR #21392:
URL: https://github.com/apache/echarts/pull/21392#issuecomment-3641384520

   > I tried the [demo](https://echarts.apache.org/examples/zh/editor.html?c=line-simple&code=TVK7TsMwFN35irsFJBQlRQgUxAADE1uRGBCD25rUwsSV61AqhMQCZYCBgZfEQ0KCjXZCqgqlP9NE7dRfwHZcp0Nu7rk-Pvfhy2qCsAjW4XQOIOSkEmgPgOIDEYC3qIFgNeuXmBDsyMIyiwQi0TYqYRqA4DFW8TNlmhsnpD7VQ9I3pCwgQ5SEUQAOJ2FVOJkcQINURDUA3zMJANgx5geUNSRV6kdlJLBlY0pJra7SOK7rmrDMnpXdrGF5oC6EjDfNaQUJFMCeEXBGg6e0_T3qvCSt3rB3OX5oj98fJ7_X6dVt-vyW_F3Mdji-GyS9z-HPB0wGfd2faxtzdeUw7PaS1uXo_HrYvUkfO5KbtF_HTxfpfSv5ekjafSWgObYJZxdXcrBTjXOwxUkOiigfk1OMIwP27cRPZiduuj9GNM7mpSl1zAmWnKz_6VOYmfgFbxEKcvLgL0uzKr8VBXxlljydaEa6hLitp15ljU1UPgw5iyO5RdNN0Ctj40XRpPLmNK1aH8q42oGwhOZ9lTA3nltYsPq6ePOTdZyt_QM&enc=deflate) in #16111, and it seems to work as expected on my end. Could you provide more details about the issue you're experiencing?
   
   Use the option : a yAxis with category data containing a long string, axisLabel.width: 300 and overflow: 'truncate', and grid.containLabel: true. The grid will be sized as if the label were its full length.
   <img width="1057" height="701" alt="line-simple (1)" src="https://github.com/user-attachments/assets/5726bdef-4bc0-43ba-966d-9678f13e6bfc" />
   here you can see the 
   
   now what i fixed is 
   
   
   > I tried the [demo](https://echarts.apache.org/examples/zh/editor.html?c=line-simple&code=TVK7TsMwFN35irsFJBQlRQgUxAADE1uRGBCD25rUwsSV61AqhMQCZYCBgZfEQ0KCjXZCqgqlP9NE7dRfwHZcp0Nu7rk-Pvfhy2qCsAjW4XQOIOSkEmgPgOIDEYC3qIFgNeuXmBDsyMIyiwQi0TYqYRqA4DFW8TNlmhsnpD7VQ9I3pCwgQ5SEUQAOJ2FVOJkcQINURDUA3zMJANgx5geUNSRV6kdlJLBlY0pJra7SOK7rmrDMnpXdrGF5oC6EjDfNaQUJFMCeEXBGg6e0_T3qvCSt3rB3OX5oj98fJ7_X6dVt-vyW_F3Mdji-GyS9z-HPB0wGfd2faxtzdeUw7PaS1uXo_HrYvUkfO5KbtF_HTxfpfSv5ekjafSWgObYJZxdXcrBTjXOwxUkOiigfk1OMIwP27cRPZiduuj9GNM7mpSl1zAmWnKz_6VOYmfgFbxEKcvLgL0uzKr8VBXxlljydaEa6hLitp15ljU1UPgw5iyO5RdNN0Ctj40XRpPLmNK1aH8q42oGwhOZ9lTA3nltYsPq6ePOTdZyt_QM&enc=deflate) in #16111, and it seems to work as expected on my end. Could you provide more details about the issue you're experiencing?
   
   <img width="1057" height="701" alt="line-simple (2)" src="https://github.com/user-attachments/assets/b23c985a-b354-4052-b9e1-e28da24b60b3" />
   you can see that the lable is not visible completely if  Use the option :  yAxis with category data containing a long string, axisLabel.width: 300 and overflow: 'truncate', and grid.containLabel: true. The grid will be sized as if the label were its full length
   


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


Re: [PR] fix(grid): respect axisLabel.width when containLabel is true [echarts]

Posted by "Rohitgiri02 (via GitHub)" <gi...@apache.org>.
Rohitgiri02 closed pull request #21392: fix(grid): respect axisLabel.width when containLabel is true
URL: https://github.com/apache/echarts/pull/21392


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


Re: [PR] fix(grid): respect axisLabel.width when containLabel is true [echarts]

Posted by "Rohitgiri02 (via GitHub)" <gi...@apache.org>.
Rohitgiri02 commented on PR #21392:
URL: https://github.com/apache/echarts/pull/21392#issuecomment-3641542435

   i tried to reproduce 
   
   > I tried the [demo](https://echarts.apache.org/examples/zh/editor.html?c=line-simple&code=TVK7TsMwFN35irsFJBQlRQgUxAADE1uRGBCD25rUwsSV61AqhMQCZYCBgZfEQ0KCjXZCqgqlP9NE7dRfwHZcp0Nu7rk-Pvfhy2qCsAjW4XQOIOSkEmgPgOIDEYC3qIFgNeuXmBDsyMIyiwQi0TYqYRqA4DFW8TNlmhsnpD7VQ9I3pCwgQ5SEUQAOJ2FVOJkcQINURDUA3zMJANgx5geUNSRV6kdlJLBlY0pJra7SOK7rmrDMnpXdrGF5oC6EjDfNaQUJFMCeEXBGg6e0_T3qvCSt3rB3OX5oj98fJ7_X6dVt-vyW_F3Mdji-GyS9z-HPB0wGfd2faxtzdeUw7PaS1uXo_HrYvUkfO5KbtF_HTxfpfSv5ekjafSWgObYJZxdXcrBTjXOwxUkOiigfk1OMIwP27cRPZiduuj9GNM7mpSl1zAmWnKz_6VOYmfgFbxEKcvLgL0uzKr8VBXxlljydaEa6hLitp15ljU1UPgw5iyO5RdNN0Ctj40XRpPLmNK1aH8q42oGwhOZ9lTA3nltYsPq6ePOTdZyt_QM&enc=deflate) in #16111, and it seems to work as expected on my end. Could you provide more details about the issue you're experiencing?
   
   When grid.containLabel was set to true and yAxis.axisLabel.width was configured with overflow: 'truncate', the grid layout calculation incorrectly used the actual text width instead of the configured width value. This caused the grid to reserve too much space for axis labels, resulting in incorrect chart layout. 


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