dosubot[bot] commented on issue #37108: URL: https://github.com/apache/superset/issues/37108#issuecomment-3746405789
<!-- Greeting --> Hi @herwinux! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the superset team. <!-- Answer --> The Mixed Chart in Superset does not currently support sorting the X-axis by metric value—this is expected behavior and not a bug. The X-axis is always sorted alphabetically by the dimension, and there is no option to customize or manually arrange the order in the UI. This limitation is recognized as a feature request by maintainers[^1][^2]. If you need to create a Pareto chart, the Bar Chart visualization is recommended. Bar Chart supports sorting the X-axis by metric value, which is essential for Pareto charts. You can enable sorting by metric in the Bar Chart controls and use advanced analytics options (like rolling sum or cumulative percentage) to overlay a Pareto line[^3][^4]. If you must use Mixed Chart, a common workaround is to pre-sort your data in SQL or your dataset and encode the desired order in a calculated field, then use that field as your X-axis[^5]. For cumulative lines, calculate the cumulative metric in your query and add it as a separate series. [^1]: [Mixed Chart X-axis sorting feature request](https://github.com/apache/superset/issues/32412) [^2]: [Customizable X-Axis Label Order in Mixed Charts](https://github.com/apache/superset/discussions/31648) [^3]: [Bar Chart sorting and analytics controls](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/explore/controlPanels/sections.tsx#L94-L274) [^4]: [Bar Chart supports sorting by metric](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/sharedControls.tsx#L387-L413) [^5]: [Workaround: pre-sort dataset or use calculated field](https://github.com/apache/superset/issues/34267) <!-- 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/338b26f1-3a89-4739-9c6d-af8905076443?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/338b26f1-3a89-4739-9c6d-af8905076443?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/338b26f1-3a89-4739-9c6d-af8905076443?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/338b26f1-3a89-4739-9c6d-af8905076443?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/338b26f1-3a89-4739-9c6d-af8905076443?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/338b26f1-3a89-4739-9c6d-af8905076443?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/338b26f1-3a89-4739-9c6d-af8905076443?feedback_type=other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github) [](https://cursor.com/link/prompt?text=The%20Mixed%20Chart%20in%20Superset%20does%20not%20currently%20support%20sorting%20the%20X-axis%20by%20metric%20value%E2%80%94this%20is%20expected%20behavior%20and%20not%20a%20bug.%20The%20X-axis%20is%20always%20sorted%20alphabetically%20by%20the%20dimension%2C%20and%20there%20is%20no%20option%20to%20customize%20or%20manually%20arrange%20the%20order%20in%20the%20UI.%20This%20limitation%20is%20recognized%20as%20a%20feature%20request%20by%20maintainers%5B%5E1%5D%5B%5E2%5D.%0A%0AIf%20you%20need%20to%20create%20a%20Pareto%20chart%2C%20the%20Bar%20Chart%20visualization%20is%20recommended.%20Bar%20Chart%20supports%20sorting%20the%20X-axis%20by%20metric%20value%2C%20which%20is%20essential%20for%20Pareto%20charts.%20You%20can%20enable%20sorting%20by%20metr ic%20in%20the%20Bar%20Chart%20controls%20and%20use%20advanced%20analytics%20options%20%28like%20rolling%20sum%20or%20cumulative%20percentage%29%20to%20overlay%20a%20Pareto%20line%5B%5E3%5D%5B%5E4%5D.%0A%0AIf%20you%20must%20use%20Mixed%20Chart%2C%20a%20common%20workaround%20is%20to%20pre-sort%20your%20data%20in%20SQL%20or%20your%20dataset%20and%20encode%20the%20desired%20order%20in%20a%20calculated%20field%2C%20then%20use%20that%20field%20as%20your%20X-axis%5B%5E5%5D.%20For%20cumulative%20lines%2C%20calculate%20the%20cumulative%20metric%20in%20your%20query%20and%20add%20it%20as%20a%20separate%20series.%0A%0A%5B%5E1%5D%3A%20%5BMixed%20Chart%20X-axis%20sorting%20feature%20request%5D%28https%3A//github.com/apache/superset/issues/32412%29%0A%5B%5E2%5D%3A%20%5BCustomizable%20X-Axis%20Label%20Order%20in%20Mixed%20Charts%5D%28https%3A//github.com/apache/superset/discussions/31648%29%0A%5B%5E3%5D%3A%20%5BBar%20Chart%20sorting%20and%20analytics%20controls%5D%28https%3A//github.com/apache/supe rset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/explore/controlPanels/sections.tsx%23L94-L274%29%0A%5B%5E4%5D%3A%20%5BBar%20Chart%20supports%20sorting%20by%20metric%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/sharedControls.tsx%23L387-L413%29%0A%5B%5E5%5D%3A%20%5BWorkaround%3A%20pre-sort%20dataset%20or%20use%20calculated%20field%5D%28https%3A//github.com/apache/superset/issues/34267%29) [](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/issues/37108) -- 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]
