Chartjs-Why chart.js doesn't show result in Bootstrap block

0👍

The import failed in try.js.

The solution is to relocate the import in chart.html.

In chart.html :

{% extends "base.html" %}

{% block js %}
    <div>
      <canvas id="myChart"></canvas>
    </div>
    <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
    <script src="../static/js/try.js"></script>
{% endblock %}

I tried this, which worked.

Leave a comment