# Chart.js — card for AI agents

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

Category: Charts and data visualisation · npm package `chart.js` · latest version 4.6.1 (checked 2026-11-01)
Install: `npm install chart.js`
License: MIT (permissive)

In your own product (generator, app, hosted service): **yes**. Permissive license: ship it inside your own product, closed or open source, and keep its license and copyright notice.

## Rules for AI agents (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 `` 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/`.

## What it is
- Chart.js is a JavaScript charting library that draws on the HTML5 `<canvas>` tag. The README tagline is "Simple yet flexible JavaScript charting for designers & developers". The GitHub repository was created on 2013-03-17 and is MIT licensed. The latest release is v4.6.1, published 2026-10-22. Its notes list a trusted-publishing fix and the version bump.
- You put a `<canvas>` on the page and load the library from npm or a CDN. Then you create `new Chart` with a chart type, labels, data points and options. The website lists 8 chart types and says each is "animated and customisable". It also says charts redraw when the window is resized.
- The site calls it "a community maintained project" and says contributions are welcome. The README sends support questions to Stack Overflow under the `chart.js` tag.

## Caveats
- 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 `/docs/2.9.4/`.
- 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.

## Numbers (AgentGid data)
- Gid Score: 78.5 (#125 of all tools, 5 of 95 in its category)
- Used in 88 public projects set up for AI coding agents (1.4%)
- Downloads last week: 17,950,574 (as of 2026-11-24), +36.9% over 4 weeks
- GitHub stars: 67,822 (as of 2026-11-24)
- Last push: 2026-11-24

## Often used with
Tailwind CSS 80.7%, React Chart.js 2 45.5%, Vite 55.7%, ESLint 64.8%, TypeScript 79.5%, Tailwind CSS Animate 27.3%

## Checked alternatives (same job)
- Recharts: https://agentgid.com/tools/recharts/agent.md
- D3.js: https://agentgid.com/tools/d3/agent.md
- Apache ECharts: https://agentgid.com/tools/echarts/agent.md
- ApexCharts: https://agentgid.com/tools/apexcharts/agent.md

## Links
- AgentGid page: https://agentgid.com/tools/chart-js/
- Homepage: https://www.chartjs.org
- Repository: https://github.com/chartjs/Chart.js
- Source: https://github.com/chartjs/Chart.js#readme
- Source: https://github.com/chartjs/Chart.js
- Source: https://github.com/chartjs/Chart.js/releases
- Source: https://www.chartjs.org/
- Source: https://www.chartjs.org/docs/latest/getting-started/installation.html
- Source: https://www.chartjs.org/docs/latest/getting-started/index

---
AgentGid's catalog is curated: every entry was checked against the maker's official pages (registry, repository, license and pricing pages) on the date shown; a license value shows the quote it stands on wherever AgentGid has one. Usage numbers come from AgentGid's own scan of public repositories set up for AI coding agents. Claims by makers are reported, not tested by AgentGid.
