{% set ID = random() %}
<div style="position: relative; height: auto; min-height: {{ settings.chartHeight }}vh; width: 100%;">
  <canvas id="submission-chart-{{ ID }}"></canvas>
</div>

{% js "https://cdn.jsdelivr.net/npm/chart.js@3.9.1/dist/chart.min.js" %}

{% js %}
  $(function () {
    setTimeout(function() {
      var ctx       = document.getElementById("submission-chart-{{ ID }}").getContext("2d");
      var chartData = {{ chartData|json_encode|raw }};
      var myChart = new Chart(ctx, chartData);
    }, 100);
  });
{% endjs %}
