Skip to content

Commit

Permalink
Fix student big board
Browse files Browse the repository at this point in the history
  • Loading branch information
willgearty committed Nov 22, 2021
1 parent 07159a4 commit 46e5a73
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions esp/esp/program/statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ def student_reg(form, programs, students, profiles, result_dict={}):
]
result_dict.update({"prog_data": prog_data,
"stat_names": stat_names,
"categories": json.dumps([program.name for program in programs.order_by('id')]),
"x_axis_categories": json.dumps([program.name for program in programs.order_by('id')]),
"left_axis_data": left_axis_data,
})
return render_to_string('program/statistics/student_reg.html', result_dict)
Expand Down Expand Up @@ -427,7 +427,7 @@ def teacher_reg(form, programs, teachers, profiles, result_dict={}):
]
result_dict.update({"prog_data": prog_data,
"stat_names": stat_names,
"categories": json.dumps([program.name for program in programs.order_by('id')]),
"x_axis_categories": json.dumps([program.name for program in programs.order_by('id')]),
"left_axis_data": left_axis_data,
})
return render_to_string('program/statistics/teacher_reg.html', result_dict)
Expand Down Expand Up @@ -481,7 +481,7 @@ def class_reg(form, programs, teachers, profiles, result_dict={}):
"stat_categories": stat_categories,
"stats_per_category": len(stat_names)/len(stat_categories),
"stat_names": [stat_name.split(' ')[1] for stat_name in stat_names],
"categories": json.dumps([program.name for program in programs.order_by('id')]),
"x_axis_categories": json.dumps([program.name for program in programs.order_by('id')]),
"left_axis_data": left_axis_data,
"right_axis_data": right_axis_data,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
shared: true,
},
xAxis: {
{% if categories %}
{% if x_axis_categories %}
type: 'category',
categories: {{ categories|safe }},
categories: {{ x_axis_categories|safe }},
{% else %}
type: 'datetime',
minRange: 24 * 60 * 60 * 1000, // one day
Expand Down Expand Up @@ -63,7 +63,7 @@
type: 'line',
yAxis: {{ forloop.parentloop.counter0 }},
name: '{{series.description}}',
{% if not categories %}
{% if not x_axis_categories %}
pointInterval: 60 * 60 * 1000, // one hour
pointStart: Date.UTC(
{{first_hour.year}}, {{first_hour.month}} - 1,
Expand All @@ -86,7 +86,7 @@
type: 'line',
yAxis: {{ forloop.parentloop.counter0 }} + left_axes,
name: '{{series.description}}',
{% if not categories %}
{% if not x_axis_categories %}
pointInterval: 60 * 60 * 1000, // one hour
pointStart: Date.UTC(
{{first_hour.year}}, {{first_hour.month}} - 1,
Expand Down

0 comments on commit 46e5a73

Please sign in to comment.