Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make graph look nice #212

Draft
wants to merge 4 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions packet/routes/upperclassmen.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,6 @@ def packet_graphs(packet_id, info=None):
agg(misc, 'misc', date)
agg(upper, 'upper', date)

# Stack misc and upper on top of fresh for a nice stacked line graph
for i in range(len(dates)):
misc[i] = misc[i] + fresh[i]
upper[i] = upper[i] + misc[i]

return render_template('packet_stats.html',
info=info,
Expand Down
17 changes: 11 additions & 6 deletions packet/templates/packet_stats.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{% block head %}
{{ super() }}
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.3/Chart.bundle.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.27.0/moment.min.js"></script>
{% endblock %}

{% block body %}
Expand Down Expand Up @@ -34,30 +35,30 @@ <h5 class="card-header bg-primary text-white">Cumulative Signatures Over Time fo
datasets: [
{
fill: 'origin',
label: 'Fresh Sigs',
label: 'Freshmen',
data: data.accum.fresh,
backgroundColor: '#b0197e80',
borderColor: '#b0197e',
borderWidth: 1,
lineTension: 0
steppedLine: true
},
{
fill: '-1',
label: 'Misc Sigs',
label: 'Alumni',
data: data.accum.misc,
backgroundColor: '#0000ff80',
borderColor: 'blue',
borderWidth: 1,
lineTension: 0
steppedLine: true
},
{
fill: '-1',
label: 'Upper Sigs',
label: 'Upperclassmen',
data: data.accum.upper,
backgroundColor: '#00ff0080',
borderColor: 'green',
borderWidth: 1,
lineTension: 0
steppedLine: true
}
]
},
Expand All @@ -68,9 +69,13 @@ <h5 class="card-header bg-primary text-white">Cumulative Signatures Over Time fo
time: {
unit: 'day',
},
ticks: {
}
}],
yAxes: [{
stacked: true,
ticks: {
max: Math.max({{ packet.signatures_required().total }}, {{packet.signatures_received().total}}),
beginAtZero: true
}
}]
Expand Down