From 5504762458e127063e36f5aa149bbdf3f6fc8f80 Mon Sep 17 00:00:00 2001 From: bryanck Date: Thu, 21 Jan 2021 23:00:58 -0800 Subject: [PATCH] add order by for bar charts (#12661) Co-authored-by: Bryan Keller --- superset/viz.py | 1 + 1 file changed, 1 insertion(+) diff --git a/superset/viz.py b/superset/viz.py index 21fbdf810..eeb4f2568 100644 --- a/superset/viz.py +++ b/superset/viz.py @@ -1648,6 +1648,7 @@ class DistributionBarViz(BaseViz): raise QueryObjectValidationError(_("Pick at least one metric")) if not fd.get("groupby"): raise QueryObjectValidationError(_("Pick at least one field for [Series]")) + d["orderby"] = [(d["metrics"][0], False)] return d def get_data(self, df: pd.DataFrame) -> VizData: