From 365143f6155567d73634d1d939b74018b940e1ad Mon Sep 17 00:00:00 2001 From: Ole Laursen Date: Fri, 5 May 2017 10:46:49 +0000 Subject: [PATCH] Don't show legend on overview chart with only one unlabelled entry - Legacy-Id: 13268 --- ietf/stats/views.py | 1 + ietf/templates/stats/meeting_stats_overview.html | 2 ++ 2 files changed, 3 insertions(+) diff --git a/ietf/stats/views.py b/ietf/stats/views.py index cfcd13501..d00c8b634 100644 --- a/ietf/stats/views.py +++ b/ietf/stats/views.py @@ -924,6 +924,7 @@ def meeting_stats(request, num=None, stats_type=None): return render(request, "stats/meeting_stats.html", { "chart_data": mark_safe(json.dumps(chart_data)), + "use_legend": chart_data and chart_data[0].get("name"), "piechart_data": mark_safe(json.dumps(piechart_data)), "table_data": table_data, "stats_title": stats_title, diff --git a/ietf/templates/stats/meeting_stats_overview.html b/ietf/templates/stats/meeting_stats_overview.html index 756d6f568..2b7ffa793 100644 --- a/ietf/templates/stats/meeting_stats_overview.html +++ b/ietf/templates/stats/meeting_stats_overview.html @@ -15,12 +15,14 @@ animation: false } }, + {% if use_legend %} legend: { align: "right", verticalAlign: "middle", layout: "vertical", enabled: true }, + {% endif %} title: { text: '{{ stats_title|escapejs }}' },