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

   ## Summary
   
   Fixes #25334 - Bar charts now emit cross-filters using the X-axis category 
value when no dimensions are configured.
   
   **The Problem:**
   When a bar chart has no "Dimensions" field set, clicking on a bar did 
nothing - cross-filtering was completely disabled. Users expected clicking on a 
bar (e.g., "Product A") to filter other charts by that X-axis value.
   
   **The Fix:**
   When no dimensions exist but the X-axis is categorical, use the X-axis 
column/value for cross-filtering:
   
   - Added `getXAxisCrossFilterDataMask()` - creates cross-filter using X-axis 
column and clicked value
   - Added `handleXAxisChange()` - emits the X-axis-based cross-filter
   - Modified click handler to check `canCrossFilterByXAxis` (categorical 
X-axis without dimensions)
   - Updated context menu to provide X-axis cross-filter option
   
   **Before:** Clicking a bar with no dimensions → nothing happens
   **After:** Clicking a bar with no dimensions → filters by X-axis category 
value
   
   ## Test plan
   
   - [x] Added unit tests for new cross-filter behavior
   - [x] Existing tests pass
   - [ ] Manual testing: Create a bar chart without dimensions, click on bars 
to verify cross-filtering works
   
   ## Technical Details
   
   The key insight was that the X-axis value is available in `props.data[0]` 
during click events, but was never used for cross-filtering. The contextmenu 
handler already had logic to extract this value for drill-to-detail, so the fix 
follows the same pattern.
   
   🤖 Generated with [Claude Code](https://claude.ai/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