Sorting of histograms

If you're trying to sort the order within a single histogram bar (column) I haven't faced this problem yet but I think it can be done with SQL alone.

To do something like what @flamber pointed out such as sort according to the height of each bar (column) within the histogram I haven't tried that precisely yet but like @AndrewMBaines indicated it can probably be done using SQL and I might just have the very thing you're looking for.

If you're trying to sort the histogram bars (columns) from left to right based on price category then have a look at the first screenshot and the SQL from my post below and adapt it to your needs (sort by height for example). Although the post has to do with custom bin-size for maps (GitHub Issue #9208), the histogram example provided may be just the thing you're trying to do. I worked really hard on this solution and it works marvelously well when embedding but I haven't tried it in the Metabase query builder interface (I rarely if ever use it). It's a pretty slick solution not just for sorting on custom text-labels but it is designed to give the embed user the ability to chose the price range and the bin-size too!

Note that I'm using MS SQL Server, it might need some tooling using MySQL, PostgreSQL, or some other SQL engine.