How to Load Chart.js from CDNs

Jan 30, 2023

We typically import Chart.js from CDNs, because Chart.js is a fairly large and complex module.

To import Chart.js using, use the following. Keep in mind that chart.umd.js is minified.

<script src=""></script>

You can also use Cloudflare:

<script src=""></script>

Or unpkg:

<script src=""></script>

For example, below is a bar chart using Chart.js from unpkg.

ChartJS 2

Below is how you can import Chart.js 2 using Cloudflare's CDN:

<script src=""></script>

Did you find this tutorial useful? Say thanks by starring our repo on GitHub!

More Chartjs Tutorials