dosubot[bot] commented on issue #41102: URL: https://github.com/apache/superset/issues/41102#issuecomment-4715591879
<!-- Answer --> Your analysis looks correct. Looking at the PR #37407 diff, the click handler uses `props.data[0]` to get the X-axis value [[1]](https://github.com/apache/superset/pull/37407): ```ts } else if (canCrossFilterByXAxis && props.data?.[0] != null) { handleXAxisChange(props.data[0]); } ``` For vertical bars, `data[0]` is the category — but for horizontal bars the tuple is flipped, so `data[0]` is the metric value instead. The test confirms this assumption — it only tests with `data: ['Product A', 100]` (vertical orientation) [[1]](https://github.com/apache/superset/pull/37407). Your proposed fix of using `props.name` instead of `props.data[0]` is the right approach. The context menu handler in the same file already uses `eventParams.name` for orientation-independent category access [[2]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/EchartsTimeseries.tsx#L182-L185), so this would make the cross-filter path consistent: ```ts } else if (canCrossFilterByXAxis && props.name != null) { handleXAxisChange(props.name); } ``` The same change should also be applied to the context menu's cross-filter section in the same PR, which has the identical `data?.[0]` pattern: ```ts } else if (canCrossFilterByXAxis && data?.[0] != null) { crossFilter = getXAxisCrossFilterDataMask(data[0]); } ``` This should use `eventParams.name` as well to remain orientation-agnostic. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=reply-with-mention&utm_term=apache%2Fsuperset).* --- Share context across your team and agents. Try [Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-tagline&utm_term=apache%2Fsuperset). [](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-feedback&utm_term=apache%2Fsuperset&message_id=f1a617a4-11d7-4964-a9b0-17e53614a85e) [](https://github.dosu.com/apache/superset?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-learn-repo&utm_term=apache%2Fsuperset) [](https://app.dosu.dev/signup?referrer=openSource&source=github-footer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-add-team&utm_term=apache%2Fsuperset) -- 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]
