Chart.js

Simple, flexible JavaScript charting for designers and developers

Library
npm
v4.5.1
67,719 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
81 /100 Excellent
Development Activity 68
Maintenance 72
Community 84
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
84 /100 Excellent
Architecture 85
Code Quality 82
Innovation 83
Learning Curve 85

Chart.js is a free, open-source JavaScript library for building responsive, animated charts on the HTML5 canvas element. It ships with eight built-in chart types — line, bar, radar, doughnut/pie, polar area, bubble, and scatter, plus mixed-type charts — along with a plugin architecture that lets you register custom controllers, elements, and scales.

With over 67,000 GitHub stars and roughly 13 million weekly npm downloads, Chart.js is one of the most widely used charting libraries in the JavaScript ecosystem. It works with vanilla JavaScript or any frontend framework via community wrapper packages (react-chartjs-2, vue-chartjs, ng2-charts), and ships type definitions for full TypeScript support out of the box.

What You Get

  • Eight core chart types (line, bar, radar, doughnut/pie, polar area, bubble, scatter) plus mixed-type charts in a single canvas
  • A tree-shakeable module system — import only the controllers, elements, and plugins you use, or pull in chart.js/auto for the full bundle
  • Built-in animation engine, responsive resizing, and accessible tooltip/legend/title plugins with no extra dependencies
  • First-class TypeScript type definitions and a public plugin API for extending charts with custom behavior

Common Use Cases

  • Rendering dashboards and admin panels for analytics products
  • Visualizing time-series and financial data with the time/timeseries scale
  • Embedding lightweight charts in marketing sites or reports where a heavier SVG library is unnecessary
  • Building custom chart types on top of Chart.js’s controller/element primitives

Under The Hood

Architecture Chart.js is built around a central Chart class (src/core/core.controller.js) that owns the render/update lifecycle and delegates type-specific behavior to a set of registered primitives. A Registry singleton (src/core/core.registry.js) maintains TypedRegistry instances for dataset controllers (src/controllers/), scales (src/scales/), elements (src/elements/), and plugins (src/plugins/), so chart types like line, bar, or radar are just controller/element pairs registered at runtime rather than hard-coded into the core. The library exposes both a manual entry point (src/index.ts, which requires calling Chart.register(…)) and an auto entry point (auto/auto.js) that eagerly registers every built-in controller, element, scale, and plugin, trading bundle size for zero-config convenience. Rendering itself goes straight to a canvas 2D context rather than SVG/DOM, coordinated by a dedicated animator (src/core/core.animator.js) that batches per-property animations across all active chart instances via requestAnimationFrame.

Tech Stack The library is written in a mix of vanilla JavaScript and TypeScript (about 89%/11% by bytes per GitHub’s language breakdown) and ships as ESM (dist/chart.js) and CJS (dist/chart.cjs) bundles built with Rollup, plus a UMD build for script-tag usage. Its only runtime dependency is @kurkle/color for color parsing and manipulation. Development tooling includes TypeScript for the ambient .d.ts declarations, ESLint with a project-specific eslint-config-chartjs, and a pnpm workspace (the chart.js core plus a separate docs package) managed under pnpm-workspace.yaml.

Code Quality Testing is extensive: the test/specs directory alone contains hundreds of spec files (586 test-related JS files across the whole test tree) covering every controller, scale, element, and plugin, run through Karma and Jasmine across multiple browsers (Chrome, Firefox, Edge, Safari) via karma.conf.cjs, with a separate test/integration suite that verifies the package works correctly when consumed from Node, TypeScript-Node, and a React browser app. Code style is enforced via ESLint (including a markdown linter for docs) and a lint-types step that runs tsc against the generated declaration files. Naming and structure are consistent across chart types (controller.<type>.js with matching test files), which keeps the large codebase navigable despite its size.

API Design The public API centers on a single new Chart(ctx, config) constructor that takes a canvas or context plus a declarative {type, data, options} config object, with no imperative chart-building calls required for common cases. The chart.js/auto subpath removes the need to call Chart.register() manually for teams that don’t care about bundle size, while the base chart.js entry point supports fully tree-shaken, register-what-you-use imports for teams that do. First-class TypeScript definitions (dist/types.d.ts) give autocomplete on config, scale, and plugin options, and the plugin API’s lifecycle hooks (beforeInit, afterUpdate, etc.) follow a consistent, well-documented naming convention that keeps custom plugin authoring approachable.

Used by 73 apps in this directory

TypeScript
51%
ZLIB

Portainer

Devops

38,590

A lightweight, open-source web UI that puts Docker, Kubernetes, and Podman management within reach of any team—no CLI expertise required.

View details
92
Repo Health
79
Technical
65
Dependency
Built with
TypeScript 51%
Go 38%
Updated 2 weeks ago
Python
55%
Other

PostHog

Ab Testing Experimentation · Analytics · Developer Tools

39,975

The all-in-one open source product platform combining analytics, session replay, feature flags, error tracking, AI observability, and a built-in data warehouse in a single self-hostable stack.

View details
92
Repo Health
80
Technical
65
Dependency
Built with
Python 55%
TypeScript 36%
Updated 1 weeks ago
TypeScript
80%
AGPL 3.0

Postiz

Automation · Social Media

36,421

The agentic social media scheduler — AI-powered content creation, 33-platform posting, and team workflows, all self-hosted.

View details
91
Repo Health
70
Technical
63
Dependency
Built with
TypeScript 80%
JavaScript 11%
Updated 1 weeks ago
TypeScript
97%
MIT

Promptfoo

AI Development

25,506

An open-source CLI and library for evaluating and red-teaming LLM applications — replace trial-and-error prompt engineering with systematic evals, vulnerability scanning, and CI/CD integration.

View details
90
Repo Health
73
Technical
68
Dependency
Built with
TypeScript 97%
Updated 1 weeks ago
Rust
72%
Apache 2.0

Rivet

AI Agents · Developer Tools

6,195

Stateful actors as a primitive for AI agents, real-time collaboration, and durable execution — with in-memory state, WebSockets, queues, and scheduling built in.

View details
86
Repo Health
81
Technical
64
Dependency
Built with
Rust 72%
TypeScript 25%
Updated 1 weeks ago
TypeScript
97%
Other

Rocket.Chat

Team Chat

46,180

The secure, self-hosted team communications platform for organizations that cannot compromise on data sovereignty.

View details
96
Repo Health
79
Technical
66
Dependency
Built with
TypeScript 97%
Updated 1 weeks ago
TypeScript
91%
MIT

SerpBear

Analytics · Marketing

2,093

Self-hosted keyword rank tracker with Google Search Console integration, multi-provider SERP scraping, and a built-in REST API.

View details
48
Repo Health
67
Technical
68
Dependency
Built with
TypeScript 91%
Updated 4 months ago
TypeScript
50%
Other

SigNoz

Analytics · Monitoring

32,224

Self-host your entire observability stack — logs, metrics, traces, and LLM monitoring — in one OpenTelemetry-native platform, without the Datadog bill.

View details
92
Repo Health
83
Technical
67
Dependency
Built with
TypeScript 50%
Go 38%
Updated 1 weeks ago
TypeScript
91%
MIT

Super Productivity

Productivity · Project Management

22,309

A privacy-respecting, local-first task manager with built-in timeboxing, Pomodoro timer, and deep integrations for Jira, GitHub, GitLab, and CalDAV — no accounts, no data collection, ever.

View details
91
Repo Health
81
Technical
72
Dependency
Built with
TypeScript 91%
Updated 1 weeks ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers