npm

npmInstallation - 图2 (opens new window) npmInstallation - 图4 (opens new window)

  1. npm install chart.js

CDN

CDNJS

cdnjsInstallation - 图6 (opens new window)

Chart.js built files are available on CDNJSInstallation - 图7 (opens new window):

https://cdnjs.com/libraries/Chart.jsInstallation - 图8 (opens new window)

jsDelivr

jsdelivrInstallation - 图10 (opens new window) jsdelivr hitsInstallation - 图12 (opens new window)

Chart.js built files are also available through jsDelivrInstallation - 图13 (opens new window):

https://www.jsdelivr.com/package/npm/chart.js?path=distInstallation - 图14 (opens new window)

Github

githubInstallation - 图16 (opens new window)

You can download the latest version of Chart.js on GitHubInstallation - 图17 (opens new window).

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.