Resolves #21
This commit is contained in:
Aaron Kimbre
2022-03-13 22:10:07 -05:00
parent 6606f1558e
commit 24e98190fe
5 changed files with 218 additions and 28 deletions

View File

@@ -0,0 +1,37 @@
{% extends 'base.html.j2' %}
{% block title %}
{{name}} History for the Last 30 Days
{% endblock title %}
{% block content_before %}
{{name}} History for the Last 30 Days
{% endblock content_before %}
{% block content %}
<canvas id="item_chart"></canvas>
{% endblock %}
{% block js %}
{{ super () }}
<script type="text/javascript" src="{{ url_for('static', filename='chartjs/chart.min.js') }}"></script>
<script>
$(document).ready(function(){
let config = {
type: 'line',
data: {
labels: {{labels}},
datasets: {{datasets}},
},
options: {
plugins: { legend: { display: false }, }
}
};
let items_chart = new Chart(
document.getElementById('item_chart'),
config
);
}
);
</script>
{% endblock %}

View File

@@ -11,8 +11,12 @@
{% block content %}
<div class="row">
<div class="col">
Items: <br/>
{% for report in reports|reverse %}
Items:
<a role="button" class="btn btn-primary btn btn-block"
href='{{url_for('reports.items_graph')}}'>
Graph
</a><br/>
{% for report in reports_items|reverse %}
<a role="button" class="btn btn-primary btn btn-block"
href='{{url_for('reports.items_by_date', date=report.date)}}'>
{{report.date}}
@@ -20,8 +24,12 @@
{% endfor %}
</div>
<div class="col">
Currency: <br/>
{% for report in reports|reverse %}
Currency:
<a role="button" class="btn btn-primary btn btn-block"
href='{{url_for('reports.currency_graph')}}'>
Graph
</a><br/>
{% for report in reports_currency|reverse %}
<a role="button" class="btn btn-primary btn btn-block"
href='{{url_for('reports.currency_by_date', date=report.date)}}'>
{{report.date}}
@@ -29,8 +37,12 @@
{% endfor %}
</div>
<div class="col">
U-Score: <br/>
{% for report in reports|reverse %}
U-Score:
<a role="button" class="btn btn-primary btn btn-block"
href='{{url_for('reports.uscore_graph')}}'>
Graph
</a><br/>
{% for report in reports_uscore|reverse %}
<a role="button" class="btn btn-primary btn btn-block"
href='{{url_for('reports.uscore_by_date', date=report.date)}}'>
{{report.date}}