chart.js Getting started with chart.js Installation or Setup


Example

Chart.js can be included in several different ways:

NPM

Run the following command on your NPM project directory

npm install chart.js --save

CDN

Include a script tag in your HTML linking to the chart.js CDN

<html>
   <body>    
      <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.1.6/Chart.bundle.min.js"></script>
   </body>
</html>

Latest version can be found at cdnjs.com/libraries/Chart.js.

Local Copy

A local copy can also be hosted on your server. You can get the lasted version from their GitHub.

<html>
   <body>    
      <script type="text/javascript" src="/Path/To/Chart.bundle.min.js"></script>
   </body>
</html>

For more information about getting chart.js installed see www.chartjs.org/docs/.