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