sfirke opened a new issue, #38249:
URL: https://github.com/apache/superset/issues/38249

   ### Bug description
   
   Backstory:
   - Continues #9998 which was closed without completion and #30575 which is a 
discussion. It's technically a feature request but feels like a bug, to not be 
able to do such an essential thing in Superset in 2026, so I'm taking the 
liberty of turning it into an issue,
   - The conversation in #34352 sprawled into this broader problem, but it 
should standalone here. Its PR #37712 might solve part or all of this.
   
   **Users need to be able to sort an x-axis in a custom order by specifying 
another variable.** See #30575 for examples. Many categorical x-axes have a 
rigid sorting order that is not alphabetical. For instance:
   - Days of the week
   - Months of the year
   - Group size data (1-5, 6-20, 21-50)
   
   As far as I know, this worked okay when we could use the legacy bar chart, 
but is a bigger problem now in Superset 6.0.0.  Right now users have to create 
a copy of the x-axis variable and preface it with numbers or varying amounts of 
whitespace as a sorting order hack. Here I am using `1.Under 18 years` so that 
it shows up first:
   
   <img width="1522" height="476" alt="Image" 
src="https://github.com/user-attachments/assets/8249b428-d6fa-45e5-911f-0ec1b62f435d";
 />
   
   
   I would rather have a separate variable in my dataset called 
`age_group_sort_order` and then I could not have the preface numbers cluttering 
up my chart.
   
   Alternatively, I have used a BI tool that lets a user type the sort order in 
the dataset UI. This would also be an acceptable way to resolve this problem, 
IMO. We could even do both: allow sort by another variable AND allow the 
original variable's sort order to be specified manually.
   
   This applies to any chart with an x-axis: bar chart, line chart, heatmap.
   
   If I'm wrong and there's a way to do this, I am happy to be proven wrong and 
I will add it to the documentation!
   
   ### Screenshots/recordings
   
   _No response_
   
   ### Superset version
   
   6.0.0
   
   ### Python version
   
   Not applicable
   
   ### Node version
   
   Not applicable
   
   ### Browser
   
   Not applicable
   
   ### Additional context
   
   _No response_
   
   ### Checklist
   
   - [x] I have searched Superset docs and Slack and didn't find a solution to 
my problem.
   - [x] I have searched the GitHub issue tracker and didn't find a similar bug 
report.
   - [x] I have checked Superset's logs for errors and if I found a relevant 
Python stacktrace, I included it here as text in the "additional context" 
section.


-- 
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