From 196c6ce028b075721d8ad3b34125ce4059ec3ab3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Sun, 16 Feb 2020 09:50:27 +0100 Subject: [PATCH] dataviz: move legend to bottom in narrow graphs (#39920) --- combo/apps/dataviz/models.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/combo/apps/dataviz/models.py b/combo/apps/dataviz/models.py index 43af268b..88a81e2d 100644 --- a/combo/apps/dataviz/models.py +++ b/combo/apps/dataviz/models.py @@ -270,6 +270,8 @@ class ChartNgCell(CellBase): else: values = [data[i][j] for j in range(len(x_labels))] chart.add(serie_label, values) + if width and width < 500: + chart.legend_at_bottom = True else: # pie, create a serie by data, to get different colours values = data