Simple stats page
This commit is contained in:
parent
137357cd12
commit
0c0fc5d797
7 changed files with 108 additions and 0 deletions
31
templates/stats.html
Normal file
31
templates/stats.html
Normal file
|
@ -0,0 +1,31 @@
|
|||
{{template "header.html" .S}}
|
||||
|
||||
<script src="/js/Chart.min.js"></script>
|
||||
|
||||
<div class="row">
|
||||
<div class="span8">
|
||||
<h4>Visits:</h4>
|
||||
<canvas id="visits" height="400"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var data = {
|
||||
labels : [{{range .Visits}}"{{.Month}}",{{end}}],
|
||||
datasets : [
|
||||
{
|
||||
fillColor : "rgba(151,187,205,0.5)",
|
||||
strokeColor : "rgba(151,187,205,1)",
|
||||
pointColor : "rgba(151,187,205,1)",
|
||||
pointStrokeColor : "#fff",
|
||||
data : [{{range .Visits}}{{.Count}},{{end}}]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
var ctx = $("#visits").get(0).getContext("2d");
|
||||
new Chart(ctx).Line(data);
|
||||
</script>
|
||||
|
||||
{{template "footer.html"}}
|
Reference in a new issue