{% extends "admin/cards/base.html" %}

{% block content %}
<canvas id="card-chart-{{ slug }}"></canvas>
{{ chart_data|json_script(slug) }}
<script>
  document.addEventListener('DOMContentLoaded', function() {
    const ctx = document.getElementById('card-chart-{{ slug }}');

    const data = JSON.parse(document.getElementById('{{ slug }}').textContent);
    new Chart(ctx, data);
  });
</script>
{% endblock %}
