[Chartjs]-Including Chart.js in a webpage without node.js and without CDN

4👍

You can clone their GitHub repo and build it yourself (npm run build from what I see from their package.json). You will need npm for this one step, but you will have a dist folder in the repository where you find all the files you need. Serve them as static resources from Django and include them in your templates as needed.

Just bear in mind that, as the say (quote below), you will be in charge of keeping Chart.js current yourself.

If you download or clone the repository, you must build Chart.js to generate the dist files. Chart.js no longer comes with prebuilt release versions, so an alternative option to downloading the repo is strongly advised.

Leave a comment