37
app/templates/reports/graph.html.j2
Normal file
37
app/templates/reports/graph.html.j2
Normal 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 %}
|
@@ -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}}
|
||||
|
Reference in New Issue
Block a user