Chart.js

v4.6.1

Simple, flexible canvas charts: bar, line, pie, doughnut, radar and more.

Quick start

Add this tag to your page. Place it just before the closing </body> tag, or in the <head> with the defer attribute.

HTML
<script src="https://jscdns.net/libs/chartjs/4.6.1/chart.umd.min.js"
        integrity="sha384-Emf5ZVIUiarAdhkgtqK+5/Z5qIvM6QoVrS+qAVtfyZVuD5lIHrac0me485+Antp0" crossorigin="anonymous"></script>

Files

FileSizeCopy
chart.umd.min.jsScript 205.2 KB

Usage

Complete example

A minimal page that loads Chart.js and uses it. Copy it into a file and open it in your browser.

example.html
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
</head>
<body>
  <canvas id="sales" height="120"></canvas>

  <script src="https://jscdns.net/libs/chartjs/4.6.1/chart.umd.min.js"
          integrity="sha384-Emf5ZVIUiarAdhkgtqK+5/Z5qIvM6QoVrS+qAVtfyZVuD5lIHrac0me485+Antp0" crossorigin="anonymous"></script>
  <script>
    new Chart(document.querySelector('#sales'), {
      type: 'bar',
      data: {
        labels: ['Jan', 'Feb', 'Mar', 'Apr'],
        datasets: [{ label: 'Orders', data: [12, 19, 7, 15] }]
      },
      options: { responsive: true }
    });
  </script>
</body>
</html>
Good to know. The UMD build registers every chart type and plugin, so no extra setup is needed.