Skip to content

Commit 365143f

Browse files
committed
Don't show legend on overview chart with only one unlabelled entry
- Legacy-Id: 13268
1 parent aff12f7 commit 365143f

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

ietf/stats/views.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -924,6 +924,7 @@ def get_country_mapping(registrations):
924924

925925
return render(request, "stats/meeting_stats.html", {
926926
"chart_data": mark_safe(json.dumps(chart_data)),
927+
"use_legend": chart_data and chart_data[0].get("name"),
927928
"piechart_data": mark_safe(json.dumps(piechart_data)),
928929
"table_data": table_data,
929930
"stats_title": stats_title,

ietf/templates/stats/meeting_stats_overview.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@ <h3>{{ stats_title }}</h3>
1515
animation: false
1616
}
1717
},
18+
{% if use_legend %}
1819
legend: {
1920
align: "right",
2021
verticalAlign: "middle",
2122
layout: "vertical",
2223
enabled: true
2324
},
25+
{% endif %}
2426
title: {
2527
text: '{{ stats_title|escapejs }}'
2628
},

0 commit comments

Comments
 (0)