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

   ### SUMMARY
   
   Fixes #38072
   
   `getXAxisFormatter()` returned `undefined` for the default smart date 
format, delegating formatting to ECharts' internal engine. PR #37181 added 
`showMaxLabel: true` to ensure the last x-axis label is always visible on 
time-series charts. However, when ECharts forces that max label to render with 
no custom formatter provided, it produces a raw timestamp string instead of a 
properly formatted date (e.g., "2023").
   
   **Root cause:** The interaction between `showMaxLabel: true` and `formatter: 
undefined` — ECharts uses its own internal formatting for the forced max label, 
which doesn't match the smart date formatting used for other labels.
   
   **Fix:** `getXAxisFormatter()` now returns the actual smart date 
`TimeFormatter` instead of `undefined`, ensuring all axis labels — including 
forced max labels — use consistent formatting. The return type is tightened 
from `TimeFormatter | StringConstructor | undefined` to `TimeFormatter`.
   
   This is a known problematic area — `showMaxLabel` was previously added (PR 
#20627) and reverted (PR #24995) for the same class of issue.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   **Before (regression):** Last x-axis label shows as raw timestamp
   
![before](https://github.com/user-attachments/assets/d5d8d821-d573-4f36-b03b-15a915dd814c)
   
   **After (fixed):** All labels use consistent smart date formatting
   
![after](https://github.com/user-attachments/assets/de9b642f-1564-4b6b-9b70-ea6601ed46c2)
   
   ### TESTING INSTRUCTIONS
   
   1. Create a bar chart with a temporal x-axis (e.g., yearly data from 
2004–2023)
   2. Use the default "smart date" x-axis time format
   3. Verify the last x-axis label displays as a formatted year (e.g., "2023"), 
not a raw timestamp
   4. Also verify with an explicit time format (e.g., `%Y-%m-%d`) that all 
labels including the last one use that format
   5. Check BigNumber with Trendline chart with "Show X Axis Min/Max Labels" 
enabled — same behavior expected
   
   ### ADDITIONAL INFORMATION
   - [x] Has associated issue: Fixes #38072
   - [ ] Required feature flags:
   - [x] 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
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


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