-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
06dae37
commit 5f39dcd
Showing
3 changed files
with
56 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
|
||
<canvas class="my-4 w-100" id="hitsPerDayChart" width="900" height="100"></canvas> | ||
|
||
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.3.2/dist/chart.umd.js" integrity="sha384-eI7PSr3L1XLISH8JdDII5YN/njoSsxfbrkCTnJrzXt+ENP5MOVBxD+l6sEG4zoLp" crossorigin="anonymous"></script> | ||
|
||
<script> | ||
/* globals Chart:false */ | ||
(() => { | ||
'use strict' | ||
// Graphs | ||
const ctx = document.getElementById('hitsPerDayChart') | ||
// eslint-disable-next-line no-unused-vars | ||
const myChart = new Chart(ctx, { | ||
type: 'line', | ||
data: { | ||
labels: [ | ||
{% for item in hitsPerDay %} | ||
'{{ item.date | simpleDate }}', | ||
{% endfor %} | ||
], | ||
datasets: [{ | ||
data: [ | ||
{% for item in hitsPerDay %} | ||
{{ item.hitCount }}, | ||
{% endfor %} | ||
], | ||
lineTension: 0, | ||
{# backgroundColor: 'transparent', #} | ||
borderColor: '#007bff', | ||
borderWidth: 2, | ||
pointBackgroundColor: '#007bff', | ||
fill: true, | ||
}] | ||
}, | ||
options: { | ||
plugins: { | ||
legend: { | ||
display: false | ||
}, | ||
tooltip: { | ||
boxPadding: 3 | ||
} | ||
}, | ||
scales: { | ||
y: { | ||
min: 0 | ||
}, | ||
}, | ||
} | ||
}) | ||
})(); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters