Don't show legend on overview chart with only one unlabelled entry

- Legacy-Id: 13268
This commit is contained in:
Ole Laursen 2017-05-05 10:46:49 +00:00
parent aff12f708a
commit 365143f615
2 changed files with 3 additions and 0 deletions

View file

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

View file

@ -15,12 +15,14 @@
animation: false
}
},
{% if use_legend %}
legend: {
align: "right",
verticalAlign: "middle",
layout: "vertical",
enabled: true
},
{% endif %}
title: {
text: '{{ stats_title|escapejs }}'
},