omsn2 opened a new pull request, #44147:
URL: https://github.com/apache/superset/pull/44147

   ### SUMMARY
   Resolves an issue where Pie charts with long category or metric names would 
overflow the chart boundaries, overlap adjacent slices, and become unreadable.
   
   This PR introduces two UI improvements:
   1. **Configurable Slice Label Overflow:** Added `Label Max Width` and `Label 
Overflow` (Truncate/Break) controls to the Pie Chart's label settings, allowing 
users to cleanly truncate slice labels using ECharts' native text engine. 
Defaults remain unchanged (0 width, meaning no limit) to preserve backward 
compatibility.
   2. **Legend Truncation & Smart Tooltips:** Fixed an issue where horizontal 
legends (`Top` / `Bottom`) would raw-clip text instead of showing an ellipsis. 
Additionally, introduced a smart legend tooltip (`makeLegendTooltip`) that 
hovers above the legend items to show the full untruncated name. The tooltip is 
conditionally suppressed if the text is short enough to fit without truncation.
   
   Fixes #39643 
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   **Before:**
   <img width="450" height="550" alt="image" 
src="https://github.com/user-attachments/assets/bbfd082d-3683-4254-934a-6ffb1091b1be";
 />
   
   
   **After:**
   <img width="471" height="542" alt="image" 
src="https://github.com/user-attachments/assets/ec8fb05b-6f46-4482-8651-6a7dd9d8efda";
 />
   
   ### TESTING INSTRUCTIONS
   1. Create a virtual dataset with extremely long category names.
   2. Create a Pie Chart grouped by that category.
   4. Turn on "Show Labels" and "Put labels outside".
   5. Set "Label Max Width" to 120 and "Label Overflow" to Truncate.
   6. Verify slice labels truncate cleanly with `...`.
   7. Enable the legend and verify that long items truncate with `...` in the 
legend.
   8. Hover over a truncated legend item and verify the tooltip appears *above* 
the item, showing the full name without overlapping the chart.
   
   ### ADDITIONAL INFORMATION
   - [x] Has associated issue: (Add your issue # here if there is one)
   - [ ] Required feature flags:
   - [x] Changes UI
   - [ ] Includes DB Migration
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


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