Skip to content
CAI
Software that uses CAICheck a score

chartjs/Chart.js

61.8

Adequate · 25 September 2026

18.4k

lines of production code

JavaScript

with TypeScript

4

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is Chart.js, a JavaScript library for rendering charts in web and Node.js environments. It supports multiple chart types including bar, line, scatter, and doughnut, utilizing a modular architecture with dedicated controllers, elements, and plugins. The library provides comprehensive TypeScript support, automated testing, and versioned documentation deployment.

How it got here

2013–2018 — TypeScript rewrite and modularization

20 changes.

The project underwent a comprehensive architectural overhaul, rewriting the core library in TypeScript and restructuring it into modular ES6 components. This period established a modern build infrastructure, introduced dedicated element and controller classes for chart rendering, and expanded the scale system with new features like TimeSeries. Extensive test suites and visual regression tests were added to validate the new modular architecture and ensure rendering stability.

2019–2020 — TypeScript migration and test expansion

22 changes.

This period focused on migrating helper modules from JavaScript to TypeScript to improve type safety and developer experience, alongside restructuring the platform abstraction for better headless environment support. Concurrently, the project significantly expanded its visual regression test suite, adding comprehensive fixtures for chart controllers, scales, plugins, and layout behaviors to ensure rendering consistency across various configurations.

2021 — Test coverage expansion and auto-registration

22 changes.

This period focused on introducing auto-registering entry points to simplify Chart.js setup for ESM and CommonJS environments. The majority of the work involved adding extensive visual regression test fixtures to verify rendering and configuration for scales, controllers, plugins, and interaction behaviors.

2022–2025 — ESM and TypeScript migration

15 changes.

The codebase was restructured to support modern ES Module and TypeScript standards, including modularizing source entry points and introducing comprehensive type definitions. This transition was accompanied by extensive integration and type-testing suites to ensure compatibility across Node.js, React, and various module resolution modes.

Features

Introduction of modular TypeScript type definitions

The library now ships with a comprehensive set of TypeScript declaration files located in \src/types\, replacing previous inline or bundled type definitions. This change introduces a modular structure with dedicated files for core concepts: \animation.d.ts\ defines the \Animation\, \Animator\, and \Animations\ classes; \geometric.d.ts\ provides interfaces for chart geometry such as \ChartArea\, \Point\, and \TRBL\; \layout.d.ts\ specifies the \LayoutItem\ and \LayoutPosition\ types used for chart element positioning; and \utils.d.ts\ exports utility types like \DeepPartial\ and \UnionToIntersection\. The main \index.d.ts\ file aggregates these modules and exports the full public API, including chart controllers, dataset options, and plugin interfaces, ensuring that consumers receive accurate type checking for configuration, data structures, and runtime objects.

src/types · high confidence

Introduction of the Colors plugin and Subtitle plugin

The library now includes two new built-in plugins: the Colors plugin, which automatically assigns distinct border and background colors to datasets that lack explicit color definitions (supporting Doughnut and PolarArea chart types), and the Subtitle plugin, which provides a secondary text label feature similar to the existing Title plugin. These additions are exposed via the central plugin registry in src/plugins/index.js alongside the core Legend, Title, Tooltip, Decimation, and Filler plugins.

src/plugins · high confidence

New auto-registering entry points for Chart.js

Chart.js now provides dedicated entry points in the 'auto' directory (auto.js, auto.cjs, and auto.d.ts) that automatically register all chart types, controllers, elements, and plugins. This allows users to import the library and immediately use all features without manually calling Chart.register, simplifying setup for both ESM and CommonJS environments.

auto · high confidence

New modular scale implementation with dedicated TimeSeries scale

The scale system has been restructured into individual ES modules, introducing a new \TimeSeriesScale\ alongside the existing \CategoryScale\, \LinearScale\, \LogarithmicScale\, \RadialLinearScale\, and \TimeScale\. This change adds support for non-linear time axes where data points are spaced according to their actual timestamps rather than being distributed equidistantly, while maintaining the standard linear, logarithmic, and categorical axis behaviors.

src/scales · high confidence

Architecture

Core library rewritten in TypeScript with modular architecture

The core library has been completely rewritten in TypeScript, introducing a modular file structure that separates concerns into distinct components such as core.adapters, core.animation, core.config, and core.controller. This refactoring establishes a new internal architecture with dedicated modules for date adapters, animation handling, configuration management, and the main chart controller, laying the groundwork for improved type safety and maintainability.

src/core · high confidence

Refactored filler plugin into modular ESM components

The filler plugin has been restructured from a single file into a modular architecture consisting of separate ESM modules for drawing, options, segments, targets, and helpers. This change improves maintainability and prepares the codebase for TypeScript, while preserving the existing fill behavior for line charts, including support for stack fills, custom boundaries, and circular scales.

src/plugins/plugin.filler · high confidence

Behavioural changes

Add CommonJS and ESM entry-point wrappers for helpers

The helpers package now includes dedicated entry-point files to support both CommonJS and ES Module consumers. A new helpers.cjs file re-exports the CommonJS build from the dist folder, while helpers.js and helpers.d.ts provide ES Module exports and type definitions pointing to the corresponding dist files, ensuring compatibility across different module systems.

helpers · high confidence

Automated versioned documentation and sample deployment

The release process now automatically deploys versioned documentation and samples to the website. New scripts handle generating version tags, updating VuePress configuration, and publishing files to the gh-pages branch, ensuring that specific documentation versions and sample redirects are available at versioned URLs.

scripts · high confidence

Introduce new Element implementations for Arc, Bar, Line, and Point

The chart rendering engine now uses dedicated element classes (ArcElement, BarElement, LineElement, PointElement) to handle drawing logic, replacing the previous monolithic or mixed approach. This change introduces specific behaviors for each chart type: ArcElement handles complex clipping and border radius calculations for pie/doughnut slices; BarElement manages bounds, border skipping, and inflation to prevent visual artifacts; LineElement supports stepped lines, cubic interpolation, and optimized path generation for sparse data; and PointElement handles point visibility and hit detection. These elements are exported via the elements index for registration and use.

src/elements · high confidence

Migration of helper modules to TypeScript

The helper modules in src/helpers (including canvas, collection, color, config, core, curve, dataset, dom, easing, extras, interpolation, intl, math, and options) have been rewritten from JavaScript to TypeScript. This change introduces strict type definitions for internal logic and public APIs, improving code reliability and developer experience without altering the runtime behavior of the library.

src/helpers · high confidence

Project infrastructure overhaul and legacy file cleanup

This change replaces the legacy build and configuration setup with a modern toolchain, introducing a new Rollup build system (rollup.config.js) that generates ES6, CommonJS, and UMD bundles, alongside a TypeScript configuration (tsconfig.json) and ESLint rules (.eslintrc.yml). It also adds a new Karma test configuration (karma.conf.cjs) and switches the package manager to pnpm (pnpm-workspace.yaml). To support this transition, the repository removes the old single-file distribution (Chart.js, Chart.min.js) and all associated sample HTML files (bar.html, line.html, etc.), while updating the README, LICENSE, and .gitignore to reflect the new structure and documentation links.

(repo-wide) · high confidence

Refactor chart controllers to ES6 classes and ESM modules

The chart controllers (Bar, Bubble, Doughnut, Line, Pie, PolarArea, Radar, and Scatter) have been rewritten as ES6 classes and converted to ES modules. This change introduces a standardized \DatasetController\ base class, enabling consistent initialization, data parsing, and element updates across all chart types. Users benefit from improved performance through optimized visible-point calculations, better support for scriptable options, and more robust handling of data visibility and stacking logic.

src/controllers · high confidence

Refactored platform abstraction with DOM detection and basic fallback

The platform layer has been restructured into distinct modules: a new \index.js\ entry point that automatically detects and returns either \DomPlatform\ or \BasicPlatform\ based on DOM support and OffscreenCanvas availability. \BasicPlatform\ is now explicitly used for non-DOM environments (like OffscreenCanvas) and disables animations by default, while \DomPlatform\ handles standard browser interactions using ResizeObserver and MutationObserver for robust attach/detach/resize detection. This change ensures charts render correctly in headless or restricted environments by falling back to a minimal platform implementation that prevents errors when DOM APIs are unavailable.

src/platform · high confidence

Restructured source entry points for ESM and TypeScript support

The library's source structure has been reorganized to support modern module systems and TypeScript. A new \src/index.ts\ serves as the primary ESM entry point, explicitly exporting core components (controllers, elements, plugins, scales) and a \registerables\ array for easy registration. A dedicated \src/index.umd.ts\ entry point handles UMD builds, ensuring global \window.Chart\ availability and compatibility with ESM extensions. Additionally, \src/types.ts\ was introduced as a temporary bridge to resolve type ambiguity during the transition, re-exporting specific classes and interfaces from the new structure.

src · high confidence

Test coverage

Added CommonJS integration tests for Chart.js and helpers; Added React integration test suite; Added TypeScript integration tests for Node.js module resolution modes; Added TypeScript type tests for Chart.js; Added TypeScript type tests for the colors plugin options; Added bar chart test fixtures for thickness, alignment, and animation; Added baseline test fixtures for bar controller; Added integration tests for Node.js CommonJS and ESM support; Added interaction test fixtures for active element rendering and nearest-point selection; Added layout test fixtures for stacked boxes, hidden axes, and scriptable padding; Added linear scale tick configuration test fixtures; Added polar area chart test fixtures; Added regression tests for category scale tick and data handling; Added snapshot tests for axis tick cross-alignment; Added snapshot tests for legend label text alignment; Added snapshot tests for line chart controller options; Added snapshot tests for point styles and rotation; Added snapshot tests for scatter chart showLine option; Added test fixture for legend border radius; Added test fixture for scriptable title plugin options; Added test fixture for stacked line chart initial render; Added test fixture for subtitle plugin; Added test fixtures for bar backgroundColor options; Added test fixtures for bar border styling; Added test fixtures for bar chart borderSkipped options; Added test fixtures for bar chart minBarLength behavior; Added test fixtures for bar chart stacking edge cases; Added test fixtures for bar controller skipNull option; Added test fixtures for bubble controller layout, radius, and point style behaviors; Added test fixtures for doughnut and pie chart edge cases; Added test fixtures for doughnut and polar area borderDash options; Added test fixtures for doughnut chart scriptable and indexable options; Added test fixtures for doughnut/pie chart border radius options; Added test fixtures for filler plugin drawTime with fill disabled; Added test fixtures for floating bar charts; Added test fixtures for grid border rendering and scriptable dash options; Added test fixtures for legend alignment, multiline rendering, and hitbox accuracy; Added test fixtures for legend layout padding; Added test fixtures for legend title alignment; Added test fixtures for line chart filler plugin dataset configurations; Added test fixtures for line element skip behavior; Added test fixtures for line filler plugin edge cases; Added test fixtures for line segment styling and alignment; Added test fixtures for linear scale tick edge cases; Added test fixtures for mixed bar/line chart configurations; Added test fixtures for monotone cubic interpolation in line charts; Added test fixtures for non-grouped bar charts; Added test fixtures for object-based and parsed bar chart data; Added test fixtures for radar chart filler plugin; Added test fixtures for radial scale point label styling and layout; Added test fixtures for radialLinear scale rendering; Added test fixtures for scale title positioning and alignment; Added test fixtures for stepped line chart variants; Added test fixtures for the Colors plugin across chart types; Added test fixtures for the selfJoin option in doughnut and pie charts; Added test fixtures for tick rendering and skipping behavior; Added test fixtures for timeseries scale configurations; Added test fixtures for x-axis autoSkip behavior; Added type tests for decimation and filler plugins; Added unit tests for chart controllers and core animation system; Added visual regression tests for bar chart border radius configurations; Added visual regression tests for scale rendering options; Added visual regression tests for tooltip styling and positioning; Establish test infrastructure and configuration.

Dependencies

Initial dependency manifests and lockfile for Chart.js v4.5.1

This change introduces the foundational dependency configuration for the project, establishing Chart.js version 4.5.1 with ESM support and a single runtime dependency on @kurkle/color. It sets up a pnpm workspace (lockfile v6) that includes the main library, a documentation site built with Vuepress, helper packages, and several integration test environments for Node.js, React, and TypeScript. The configuration also adds a PHP Composer manifest for the library and enforces pnpm version 8+.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 40 → 62 (+21.4)
  • Rubric changed (rubric-2026.08.15 → rubric-2026.09.15) — scores are not directly comparable.

Lenses

  • Code Health 57 → 69 (+12.1)
  • Architecture 87 (new)
  • Maturity 67 → 68 (+0.8)
  • Readiness 32 → 71 (+38.9)
  • Security 38 → 52 (+14.0)

Resolved (107)

  • Boundary-crossing change coupling: controller.bar.js ↔ element.bar.js (src/controllers/controller.bar.js)
  • Change coupling: controller.bar.js ↔ controller.bubble.js (src/controllers/controller.bar.js)
  • Change coupling: controller.bar.js ↔ controller.pie.js (src/controllers/controller.bar.js)
  • Change coupling: controller.bubble.js ↔ controller.line.js (src/controllers/controller.bubble.js)
  • Change coupling: controller.doughnut.js ↔ controller.polarArea.js (src/controllers/controller.doughnut.js)
  • Change coupling: controller.line.js ↔ controller.radar.js (src/controllers/controller.line.js)
  • Change coupling: controller.polarArea.js ↔ controller.radar.js (src/controllers/controller.polarArea.js)
  • Change coupling: core.controller.js ↔ core.registry.js (src/core/core.controller.js)
  • Change coupling: core.controller.js ↔ platform.base.js (src/core/core.controller.js)
  • Change coupling: plugin.legend.js ↔ plugin.title.js (src/plugins/plugin.legend.js)
  • Critical CVE: [GHSA redacted] (pnpm-lock.yaml)
  • Critical CVE: [GHSA redacted] (pnpm-lock.yaml)
  • Critical CVE: [GHSA redacted] (pnpm-lock.yaml)
  • Critical CVE: [GHSA redacted] (pnpm-lock.yaml)
  • Critical CVE: [GHSA redacted] (pnpm-lock.yaml)
  • Critical CVE: [GHSA redacted] (pnpm-lock.yaml)
  • Critical CVE: [GHSA redacted] (pnpm-lock.yaml)
  • Critical CVE: [GHSA redacted] (pnpm-lock.yaml)
  • Critical CVE: [GHSA redacted] (pnpm-lock.yaml)
  • Critical CVE: [GHSA redacted] (pnpm-lock.yaml)
  • …and 87 more

New (197)

  • Animations._createAnimations (cognitive 16) (src/core/core.animations.js)
  • BarController._calculateBarValuePixels (cognitive 18) (src/controllers/controller.bar.js)
  • BarController.updateElements (cyclomatic 16) (src/controllers/controller.bar.js)
  • ClassTooLong: Chart (src/core/core.controller.js)
  • ClassTooLong: DatasetController (src/core/core.datasetController.js)
  • ClassTooLong: Scale (src/core/core.scale.js)
  • ClassTooLong: Tooltip (src/plugins/plugin.tooltip.js)
  • Concentrated knowledge decay
  • Critical CVE: [GHSA redacted] (pnpm-lock.yaml)
  • Critical CVE: [GHSA redacted] (pnpm-lock.yaml)
  • Critical CVE: [GHSA redacted] (pnpm-lock.yaml)
  • Critical CVE: [GHSA redacted] (pnpm-lock.yaml)
  • Critical CVE: [GHSA redacted] (pnpm-lock.yaml)
  • Critical CVE: [GHSA redacted] (pnpm-lock.yaml)
  • Critical CVE: [GHSA redacted] (pnpm-lock.yaml)
  • Critical CVE: [GHSA redacted] (pnpm-lock.yaml)
  • Critical CVE: [GHSA redacted] (pnpm-lock.yaml)
  • Critical CVE: [GHSA redacted] (pnpm-lock.yaml)
  • Critical vulnerability: [GHSA redacted] (pnpm-lock.yaml)
  • DatasetController.parse (cognitive 21) (src/core/core.datasetController.js)
  • …and 177 more

Changes since last survey

  • 10 commits — 10 feature/other, 0 fixes

By area

  • .github/workflows — 6 commits
  • (root) — 2 commits
  • docs/axes — 1 commit
  • test/fixtures — 1 commit

Notable commits

  • change: Add a note that axis labels can span lines (#12258)
  • change: Bump actions/checkout from 6 to 7 (#12303)
  • change: Bump actions/setup-node from 6 to 7 (#12306)
  • change: Bump minimatch from 3.1.2 to 3.1.5 (#12207)
  • change: Bump pnpm/action-setup from 4.2.0 to 6.1.0 (#12307)
  • change: Bump preactjs/compressed-size-action from 2 to 3 (#12163)
  • change: Bump rollup from 3.20.2 to 3.30.0 (#12206)
  • change: Specify build script for compressed size (#12310)
  • change: Use node 24 for CI (#12309)
  • change: filler plugin fill extends past line when offset: true + index scale min/max (#12283)

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

chartjs/Chart.js was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 25 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 6a86e238fac3d1ad35eb84b93e7804dfb5813f79 — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-dd72cc24c749.