EnxDev opened a new pull request, #37755: URL: https://github.com/apache/superset/pull/37755
<!--- Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/ Example: fix(dashboard): load charts correctly --> ### SUMMARY <!--- Describe the change below, including rationale and design decisions --> When using a bar chart with a verbose date format (e.g. `%d-%m-%Y %H:%M:%S`) and a rotated x-axis (e.g. -45°), the last date label either disappeared entirely or was truncated at the chart boundary. In some cases a phantom date label appeared at the axis edge that did not correspond to any data point. The root cause was a combination of three issues in the ECharts timeseries axis configuration. First, `hideOverlap: true` was set unconditionally for all time axes. ECharts overlap detection is known to conflict with forced label visibility, causing it to aggressively hide labels — including the last one — when rotated long date strings produce large bounding boxes. Second, `showMaxLabel: true` and alignMaxLabel: 'right' were being applied to force the last label to render, but showMaxLabel displays a label at the axis boundary rather than at the last data point, creating a phantom date with no corresponding bar. Third, the default right grid padding (20px) was insufficient for long rotated labels, leading to clipping. This PR replaces all three workarounds with a simpler approach: `hideOverlap` is now conditionally disabled only when label rotation is applied on time axes, since rotated labels naturally have less overlap and the time axis already manages tick density via its `interval` setting. The `showMaxLabel` and `alignMaxLabel` overrides are removed entirely, eliminating phantom labels. Finally, dynamic right padding is added proportional to the rotation angle to prevent clipping of the last label. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF <!--- Skip this if not applicable --> - Before https://github.com/user-attachments/assets/c713eccb-1c86-4373-a3b7-c5eff16df90d - After https://github.com/user-attachments/assets/ef558e70-e600-4233-809e-8965ab0f34e6 - Before <img width="1769" height="953" alt="before-45" src="https://github.com/user-attachments/assets/fed89ee6-975a-4c26-bcbf-4f8e56db15d4" /> - After <img width="1763" height="953" alt="after-45" src="https://github.com/user-attachments/assets/2d9599e7-f152-4df9-ab48-044f0f0a875a" /> ### TESTING INSTRUCTIONS <!--- Required! What steps can be taken to manually verify the changes? --> 1. Create a bar chart with a temporal x-axis 2. Set x-axis time format to %d-%m-%Y %H:%M:%S 3. Set "Rotate x axis label" to -45 4. Verify the last date label is fully visible and not truncated 5. Verify no extra date label appears at the axis boundary without a corresponding bar 6. Change rotation back to 0 and verify long date labels do not overlap each other 7. Test with 45 rotation as well ### ADDITIONAL INFORMATION <!--- Check any relevant boxes with "x" --> <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue --> - [ ] Has associated issue: - [ ] Required feature flags: - [ ] Changes UI - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351)) - [ ] Migration is atomic, supports rollback & is backwards-compatible - [ ] Confirm DB migration upgrade and downgrade tested - [ ] Runtime estimates and downtime expectations provided - [ ] 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]
