Skip to content
Agents tracked: 506 Releases (7d): 634 Agent status: 4 with issuesSince last limit reset: Claude 15d · Codex 0d For AI agents: Markdown Updated Nov 26, 2026

Chart.js

Simple HTML5 canvas-based charting library for creating interactive data visualizations.

Charts and data visualisationNPM

GitHubWebsite

1. License

License from npm.

github.com/chartjs/Chart.js

From the package registry and GitHub, checked daily. Tap a verdict to see its source.How we checkedReport an error

What Chart.js does

Chart.js draws charts on an HTML5 <code>&lt;canvas&gt;</code> from one <code>new Chart(ctx, config)</code> call that takes a plain config object, and since v4 registering only the components you need can shrink the bundle.

Chart.js popularity

78 / 100
Gid Score, #125 overall
18M
downloads a week, npm
67.8K
GitHub stars
88
agent projects use it
Chart.js: downloads per weeknpm, chart.js 17,950,574
Chart.js: GitHub starschartjs/Chart.js 67,822

Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated

How Chart.js is used

  • Chart.js is a dependency in 88 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (1.8% of the 4,867 JavaScript/TypeScript ones), #3 of 95 in charts and data visualisation.
  • Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 252; those are left out of every share on this page.
  • The most used alternative in our scan is Recharts (576 projects).
  • Projects that use it most often also use Tailwind CSS (80.7%), React Chart.js 2 (45.5%), Vite (55.7%).
  • It is more common in projects set up for Junie (8.1%) than for GitHub Copilot (1.4%).

By coding agent

49 projects, 1.5%
46 projects, 1.9%
43 projects, 1.4%
12 projects, 3.5%
8 projects, 1.7%
7 projects, 1.5%
6 projects, 8.1%
5 projects, 1.8%

Often used with

In 80.7% of its projects
In 45.5% of its projects
In 55.7% of its projects
In 64.8% of its projects
In 79.5% of its projects
In 27.3% of its projects
In 28.4% of its projects
In 45.5% of its projects

Chart.js in practice

Strengths

A chart is one config object

The getting-started example uses a <code>&lt;canvas&gt;</code>, one CDN script tag and a single <code>new Chart(ctx, {...})</code> call. That call holds the type, labels, data and options.

Register only what you draw

Version 4 added tree-shaking. The site says registering only the components you need can reduce the bundle "by dozens of kilobytes".

A 1M-point showcase

The maintainers list performance work in 3.0. Their example plots 1M points with the decimation plugin enabled.

Bar and line in one chart

Since 2.0 you can mix bar and line charts. The site says this gives a clear visual distinction between datasets.

Watch out for

Cloning the repo gives you no dist files

The docs say Chart.js "no longer comes with prebuilt release versions". If you download or clone the repository, you must build it to get the dist files. The docs strongly advise using another install option.

Docs links default to v4

All README documentation links point to version 4. If you are on an older version, you have to put the version number in the docs URL yourself, for example <code>/docs/2.9.4/</code>.

Server-side images take extra plumbing

The Chart Splat builders write that using Chart.js from PHP or other non-Node backends means running a separate Node.js service or a headless browser. They built their API because of that gap.

The script from the getting-started bar chart (needs a canvas with id myChart)

const ctx = document . getElementById ( 'myChart' ) ;
new Chart ( ctx , {
  type : 'bar' ,
  data : {
    labels : [ 'Red' , 'Blue' , 'Yellow' , 'Green' , 'Purple' , 'Orange' ] ,
    datasets : [ {
      label : '# of Votes' ,
      data : [ 12 , 19 , 3 , 5 , 2 , 3 ] ,
      borderWidth : 1
    } ]
  } ,
  options : {
    scales : {
      y : {
        beginAtZero : true
      }
    }
  }
} ) ;

More about Chart.js

Head to head
Packages around it
  • tailwindcss: Utility-first CSS
  • react-chartjs-2: React wrapper for Chart.js
  • vite: Build tool and dev server
  • typescript: Typed JavaScript
  • eslint: JavaScript linter
  • tailwindcss-animate: Tailwind animation utilities
More in Charts and data visualisation

Alternatives

Chart.js This page

MITGid 7818M/wk

Recharts

Composable React component library for building responsive charts.

MITGid 8571.4M/wk

D3.js

JavaScript library for creating data-driven documents with powerful data visualization capabilities.

ISCGid 8136M/wk

Apache ECharts

Powerful interactive charting library for data visualization in browsers.

Apache-2.0Gid 7511.4M/wk

ApexCharts

Interactive JavaScript charting library for creating modern data visualizations.

SEE LICENSE IN LICENSE.mdGid 602.9M/wk

Compare Chart.js with another tool

Get started

Install it.

npm install chart.js

Rules for your agent

Paste into AGENTS.md or CLAUDE.md
## Chart.js
- Install with `npm install chart.js`, or load the built files from CDNJS or jsDelivr. Do not download or clone the repository for dist files: Chart.js no longer comes with prebuilt release versions, so you would have to build it.
- Give each chart's `<canvas>` its own container element. The docs recommend this for responsiveness.
- Create charts with `new Chart(ctx, { type, data, options })`, where `ctx` is the canvas element.
- In bundled apps, consider registering only the components a chart needs. The site says this can reduce bundle size by dozens of kilobytes.
- Docs links point to v4. If a project pins an older version, read the versioned docs, e.g. `https://www.chartjs.org/docs/2.9.4/`.