GitHub user dosubot[bot] added a comment to the discussion: ECharts Bar Chart: Cannot sort descending by total metric when applying a Dimension (Sorts Alphabetically instead)
<!-- Greeting --> Hi @LoneWolfRakesh! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the superset team. <!-- Answer --> This is a **confirmed bug** in Superset's ECharts bar chart implementation. You're not doing anything wrong—when dimensions are added, the sorting logic fails to apply the configured sort settings and defaults to alphabetical ordering. **Issue**: [#34352 - Bar chart "X-AXIS SORT BY" options differ when "DIMENSIONS" is set](https://github.com/apache/superset/issues/34352) **Fix status**: [PR #37712](https://github.com/apache/superset/pull/37712) addresses this issue but has **not been merged yet** (as of Feb 2026). This affects versions 4.1.3, 4.1.4, and 6.0.0. **Available workarounds**: 1. **Pre-sort data in your dataset** — Create a calculated column that encodes the desired sort order (e.g., using ROW_NUMBER or a ranking function), then use "Category name" sorting which will respect your pre-encoded order. 2. **Use the legacy Bar Chart** — The "Bar Chart (legacy)" chart type reportedly still allows metric-based sorting when dimensions are configured. Unfortunately, the Custom CSS/JSON tricks won't help here since the issue is in the data transformation logic before the data reaches ECharts—[the `isMultiSeries` flag causes the axis sorting settings to not be properly applied when dimensions are present](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts#L235-L251). A maintainer acknowledged this as ["an unacceptable lack of functionality"](https://github.com/apache/superset/issues/34352#issuecomment-3836112713), so the fix should hopefully land soon. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/c65b54c5-beb8-4853-9291-6674193041b0?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/c65b54c5-beb8-4853-9291-6674193041b0?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/c65b54c5-beb8-4853-9291-6674193041b0?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/c65b54c5-beb8-4853-9291-6674193041b0?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/c65b54c5-beb8-4853-9291-6674193041b0?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/c65b54c5-beb8-4853-9291-6674193041b0?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/c65b54c5-beb8-4853-9291-6674193041b0?feedback_type=other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github) [](https://cursor.com/link/prompt?text=This%20is%20a%20%2A%2Aconfirmed%20bug%2A%2A%20in%20Superset%27s%20ECharts%20bar%20chart%20implementation.%20You%27re%20not%20doing%20anything%20wrong%E2%80%94when%20dimensions%20are%20added%2C%20the%20sorting%20logic%20fails%20to%20apply%20the%20configured%20sort%20settings%20and%20defaults%20to%20alphabetical%20ordering.%0A%0A%2A%2AIssue%2A%2A%3A%20%5B%2334352%20-%20Bar%20chart%20%22X-AXIS%20SORT%20BY%22%20options%20differ%20when%20%22DIMENSIONS%22%20is%20set%5D%28https%3A//github.com/apache/superset/issues/34352%29%0A%0A%2A%2AFix%20status%2A%2A%3A%20%5BPR%20%2337712%5D%28https%3A//github.com/apache/superset/pull/37712%29%20addresses%20this%20issue%20but%20has%20%2A%2Anot%20been%20merged%20yet%2A%2A%20%28as%20of%20Feb%202026%29.%20This%20affects%20ve rsions%204.1.3%2C%204.1.4%2C%20and%206.0.0.%0A%0A%2A%2AAvailable%20workarounds%2A%2A%3A%0A%0A1.%20%2A%2APre-sort%20data%20in%20your%20dataset%2A%2A%20%E2%80%94%20Create%20a%20calculated%20column%20that%20encodes%20the%20desired%20sort%20order%20%28e.g.%2C%20using%20ROW_NUMBER%20or%20a%20ranking%20function%29%2C%20then%20use%20%22Category%20name%22%20sorting%20which%20will%20respect%20your%20pre-encoded%20order.%0A%0A2.%20%2A%2AUse%20the%20legacy%20Bar%20Chart%2A%2A%20%E2%80%94%20The%20%22Bar%20Chart%20%28legacy%29%22%20chart%20type%20reportedly%20still%20allows%20metric-based%20sorting%20when%20dimensions%20are%20configured.%0A%0AUnfortunately%2C%20the%20Custom%20CSS/JSON%20tricks%20won%27t%20help%20here%20since%20the%20issue%20is%20in%20the%20data%20transformation%20logic%20before%20the%20data%20reaches%20ECharts%E2%80%94%5Bthe%20%60isMultiSeries%60%20flag%20causes%20the%20axis%20sorting%20settings%20to%20not%20be%20properly%20applied%20when%20dimensions%20are%20present%5D%28https% 3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts%23L235-L251%29.%20%0A%0AA%20maintainer%20acknowledged%20this%20as%20%5B%22an%20unacceptable%20lack%20of%20functionality%22%5D%28https%3A//github.com/apache/superset/issues/34352%23issuecomment-3836112713%29%2C%20so%20the%20fix%20should%20hopefully%20land%20soon.) [](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/discussions/38245) GitHub link: https://github.com/apache/superset/discussions/38245#discussioncomment-15921151 ---- This is an automatically sent email for [email protected]. To unsubscribe, please send an email to: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
