You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "rusackas (via GitHub)" <gi...@apache.org> on 2025/07/31 19:48:32 UTC
[PR] fix(echarts): resolve bar chart X-axis time formatting stuck on adaptive [superset]
rusackas opened a new pull request, #34436:
URL: https://github.com/apache/superset/pull/34436
### SUMMARY
This PR fixes issue #30373 where bar chart X-axis time formatting was stuck on "adaptive" and couldn't be changed to other formats.
**Root Cause**: The `DEFAULT_FORM_DATA` in `Timeseries/constants.ts` was missing the `xAxisTimeFormat` field, causing it to be `undefined` and falling back to adaptive formatting.
**Solution**: Added `xAxisTimeFormat: 'smart_date'` to the default form data, ensuring bar charts have proper time formatting by default and can be customized by users.
**Changes Made**:
- ✅ Add `xAxisTimeFormat: 'smart_date'` to `DEFAULT_FORM_DATA` in `constants.ts`
- ✅ Add comprehensive test coverage with 23 tests across 3 test files
- ✅ Tests verify control panel configuration, transform props behavior, and regression prevention
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
**Before**: Bar chart X-axis time formatting was stuck on adaptive formatting regardless of user selection
**After**: Users can now change X-axis time formatting to any supported format (%Y-%m-%d, %b %Y, etc.)
### TESTING INSTRUCTIONS
1. Create a new bar chart with time data on the X-axis
2. Go to "Chart Options" → "X Axis" section in the control panel
3. Change the "Time format" from "Adaptive formatting" to a custom format (e.g., "%Y-%m-%d")
4. Click "Update chart"
5. Verify the X-axis labels now use the selected format instead of being stuck on adaptive
**Automated Testing**:
```bash
npm test -- test/Timeseries/constants.test.ts test/Timeseries/Bar/transformProps.test.ts test/Timeseries/Bar/controlPanel.test.ts
```
### ADDITIONAL INFORMATION
- [x] Has associated issue: Fixes #30373
- [ ] Required feature flags: N/A
- [ ] Changes UI: Yes (fixes broken UI functionality)
- [ ] Includes DB Migration: No
- [ ] Introduces new feature or API: No
- [ ] Removes existing feature or API: No
**Test Coverage**: 23 tests added covering:
- Default form data validation
- Bar chart transform props with various time formats
- Control panel configuration
- Orientation-specific behavior (vertical/horizontal)
- Integration with existing features (bounds, rotation, etc.)
- Regression prevention for issue #30373
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <no...@anthropic.com>
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(echarts): resolve bar chart X-axis time formatting stuck on adaptive [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas merged PR #34436:
URL: https://github.com/apache/superset/pull/34436
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org