Chartjs-Nodejs express jade mongodb project: how to import include chart.js

0👍

Try the CDN method by adding this to the layout.pug anywhere in the head section:

script(src='https://cdnjs.com/libraries/Chart.js')

Take a look at this question to see more details on how to reference chartjs as a local file from node_modules.

CDN is a lot easier to configure and will also be more economical as your server won’t bear the load of serving the library to your users.

Leave a comment