mise en place de stats

This commit is contained in:
2020-10-14 12:01:28 +02:00
parent a6acd26a5c
commit 1d7ad9bfc0
4 changed files with 261 additions and 1 deletions

View File

@@ -0,0 +1,114 @@
{% extends 'base.html.twig' %}
{% block body %}
<h1 class="page-header">
STATISTIQUES
</h1>
<div class="row">
<div class="col-md-6">
<div class="card homecard" style="width: 100%; height: 600px;">
<div class="card-header">
DEV
</div>
<div class="card-body">
<div id="chart-1" style="height: 250px;"></div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="card homecard" style="width: 100%; height: 600px;">
<div class="card-header">
CSS
</div>
<div class="card-body">
<div id="chart-3" style="height: 250px;"></div>
</div>
</div>
</div>
</div>
{% endblock %}
{% block localjavascript %}
$(document).ready(function() {
graphDEV();
graphCSS();
});
function graphDEV() {
new Morris.Line({
element: 'chart-1',
xkey: 'month',
ykeys: [
'Total',
{% for nature in tbnatures %}
'{{ nature.name }}',
{% endfor %}
],
data: [
{% for month in tbmonths %}
{ month: '{{ month.name }}',
{% for nature in month.services[1].natures %}
{% if loop.first %}
'Total': {{ nature.totalservice }},
{% endif %}
'{{ nature.name }}': {{ nature.totalnature }},
{% endfor %}
},
{% endfor %}
],
labels: [
'Total',
{% for nature in tbnatures %}
'{{ nature.name }}',
{% endfor %}
]
});
}
function graphCSS() {
new Morris.Line({
element: 'chart-3',
xkey: 'month',
ymax: 160,
ykeys: [
'Total',
{% for nature in tbnatures %}
'{{ nature.name }}',
{% endfor %}
],
data: [
{% for month in tbmonths %}
{ month: '{{ month.name }}',
{% for nature in month.services[3].natures %}
{% if loop.first %}
'Total': {{ nature.totalservice }},
{% endif %}
'{{ nature.name }}': {{ nature.totalnature }},
{% endfor %}
},
{% endfor %}
],
labels: [
'Total',
{% for nature in tbnatures %}
'{{ nature.name }}',
{% endfor %}
]
});
}
{% endblock %}
{% block localexternalscript %}
<script src="//cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.min.js"></script>
{% endblock %}

View File

@@ -372,7 +372,13 @@
</a>
</li>
<li class="last">
<li>
<a href="{{path("app_stat_view")}}">
<i class="fas fa-chart-line"></i>Statistiques
</a>
</li>
<li class="last">
<a href="{{path("app_export_view")}}">
<i class="fa fa-file-download"></i>Exports
</a>