You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "dosubot[bot] (via GitHub)" <gi...@apache.org> on 2026/05/02 03:07:31 UTC
Re: [D] X-Axis Sort By does not work without Dimensions [superset]
GitHub user dosubot[bot] edited a comment on the discussion: X-Axis Sort By does not work without Dimensions
<!-- Answer -->
The way X-Axis Sort By works in Superset is intentional and depends on whether you have dimensions (groupby fields) selected. When no dimension is set, you can sort by any column or metric in your dataset. As soon as you add a dimension, the sort options are restricted to a fixed set: category name, total value, min, max, and average value. This is hardcoded in the frontend and not a backend limitation or bug—it's how the control is designed to work in Superset [[source](https://github.com/apache/superset/issues/34352)].
If you want to sort by a metric when no dimensions are present, this should work in bar charts and similar chart types. If it's not working, double-check that your chart type supports this and that your configuration matches the expected setup. For chart types where this isn't supported (like Mixed Chart or some line charts), it's a feature request and not currently available [[source](https://github.com/apache/superset/issues/32412)].
There isn't a built-in workaround to sort by an arbitrary dataset column when a dimension is set. If you need a specific order, consider pre-sorting your data in the dataset or creating a calculated column that encodes your desired order, then use "Category name" sorting [[source](https://github.com/apache/superset/issues/34352)].
The relevant logic for this behavior is in the frontend code, specifically in the `xAxisSortControl` and `sortOperator` functions. Changing this would require a code enhancement [[source](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/customControls.tsx#L59-L151)].
If you have a specific chart type or scenario where sorting by metric is not working as expected without dimensions, let me know which chart type and configuration you're using, and I can help you dig deeper.
<!-- 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=9c8b9254-d053-435a-901d-9b8f261c936a) [](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)
GitHub link: https://github.com/apache/superset/discussions/36290#discussioncomment-15086947
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org