cullmann.io/themes/blowfish/layouts/shortcodes/chart.html

13 lines
384 B
HTML
Raw Permalink Normal View History

{{ $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>