mysticalayushi opened a new pull request, #41505:
URL: https://github.com/apache/superset/pull/41505
### SUMMARY
When using sub-hour time grains (Minute, 5 Minutes, 10 Minutes, 15 Minutes,
30 Minutes, Second) on ECharts time-series charts, the X-axis labels were
incorrectly collapsing all timestamps within the same hour to show identical
labels (e.g., "10 AM" for both 10:15 and 10:30).
Root cause: In `getSmartDateFormatter()` inside `formatters.ts`, all
sub-hour
grains including Minute and Second were being normalized to the top of the
hour
(minutes and seconds set to 0), causing multiple distinct data points to
render
with the same label.
Fix: Split the combined sub-hour block into three separate cases:
- HOUR: normalize to top of hour (existing behavior, correct)
- MINUTE/5M/10M/15M/30M: preserve hour and minute
- SECOND: preserve hour, minute, and second
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
<!-- Screenshots not available as local environment not set up.
The fix is in formatters.ts getSmartDateFormatter() function. -->
### TESTING INSTRUCTIONS
1. Create a Time-series Bar or Line chart in Explore
2. Set the time grain to "Minute", "15 minutes", or "30 minutes"
3. Set X-axis time format to "Adaptive Formatting"
4. Observe the X-axis labels now correctly show distinct times
(e.g., "10:15", "10:30") instead of all showing the same hour label
5. Verify HOUR grain still works correctly (shows "10 AM", "11 AM" etc.)
6. Verify DAY/WEEK/MONTH/YEAR grains are unaffected
### ADDITIONAL INFORMATION
- [x] Has associated issue: Fixes #41452
- [ ] 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
--
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]