This commit is contained in:
parent
4b35583782
commit
e77051ccc4
1987 changed files with 1147290 additions and 5648 deletions
12
themes/blowfish/layouts/shortcodes/chart.html
Normal file
12
themes/blowfish/layouts/shortcodes/chart.html
Normal file
|
@ -0,0 +1,12 @@
|
|||
{{ $id := delimit (slice "chart" (partial "functions/uid.html" .)) "-" }}
|
||||
<div class="chart">
|
||||
<canvas id="{{ $id }}"></canvas>
|
||||
<script type="text/javascript">
|
||||
window.addEventListener("DOMContentLoaded", (event) => {
|
||||
const ctx = document.getElementById("{{ $id }}");
|
||||
const chart = new Chart(ctx, {
|
||||
{{ .Inner | safeJS }}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
Loading…
Add table
Add a link
Reference in a new issue