Skip to content
CAI
Software that uses CAICheck a score

chartjs/Chart.js

59.7

Adequate · 13 November 2026

17.5k

lines of production code

JavaScript

with TypeScript

7

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 various chart types including bar, line, doughnut, and radar visualizations. It provides a modular architecture with dedicated controllers, elements, and scales, supporting both ESM and CommonJS module systems. The library includes built-in plugins for features like tooltips, legends, and automatic color assignment, along with comprehensive TypeScript type definitions for type-safe configuration.

How it got here

2013–2019 — TypeScript migration and modular architecture

29 changes.

The project underwent a comprehensive rewrite of its core library and helper modules into TypeScript, establishing a modular architecture with dedicated classes for elements, scales, and controllers. This structural overhaul was accompanied by a modernization of the build infrastructure and the introduction of extensive visual regression tests to ensure rendering stability across all chart types.

2020–2021 — test coverage expansion and module support

38 changes.

This period focused on significantly expanding visual regression test coverage across scales, controllers, and plugins to ensure rendering consistency. It also introduced automated versioned documentation deployment and enhanced module compatibility with CommonJS and ESM entry points for helpers and auto-registration.

2022–2025 — ESM and TypeScript migration

20 changes.

The codebase was restructured to support modern ES Modules and TypeScript, featuring modular source entry points and comprehensive type definitions. This transition was accompanied by extensive integration and type-checking tests to ensure compatibility across Node.js, React, and various module systems.

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 configuration and defaults; Added TypeScript type tests for plugins and tooltip; 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 baseLine options; 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 gap handling; Added snapshot tests for point styles and rotation; Added snapshot tests for radar chart controller options; 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 border styling; 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 border join styles; 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 chart tension options; Added test fixtures for line segment styling and alignment; Added test fixtures for linear scale grace behavior; Added test fixtures for linear scale tick edge cases; Added test fixtures for logarithmic scale 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 line filler plugin; 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 DOM and options helpers; Added type tests for chart controller options; Added type tests for chart elements, plugins, scales, and layout positions; Added type tests for scale options and grid configurations; Added type tests for tick formatter 'this' context; 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 line chart controller options; 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 cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 58 → 60 (+1.4)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.3) — scores are not directly comparable.

Lenses

  • Code Health 54 → 54 (+0.0)
  • Architecture 90 → 90 (-0.1)
  • Maturity 69 → 71 (+1.5)
  • Readiness 69 → 69 (-0.0)
  • Security 51 → 53 (+2.8)
  • Performance 100 → 100 (+0.0)

Resolved (18)

  • Documentation: no installation or build instructions (docs/configuration/index.md)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High secret: WD-SECRET-0005 (package-lock.json)
  • High vulnerability: [GHSA redacted] (pnpm-lock.yaml)
  • Inconsistent parameter ordering and naming for date manipulation operations. add takes (timestamp, amount, unit), while diff takes (a, b, unit). startOf and endOf take (timestamp, unit). The unit parameter is the last argument in add and diff, but the second argument in startOf and endOf. This inconsistency in parameter position for the unit argument across similar date manipulation methods can lead to errors.
  • Medium CVE: [GHSA redacted] (pnpm-lock.yaml)
  • Medium CVE: [GHSA redacted] (pnpm-lock.yaml)
  • Medium CVE: [GHSA redacted] (pnpm-lock.yaml)
  • Medium CVE: [GHSA redacted] (pnpm-lock.yaml)
  • Rotate the exposed credentials — git history can't be un-committed
  • TimeSeriesScale exposes getDecimalForValue, but TimeScale (its likely parent or related type) also exposes it. While TimeSeriesScale is a specialized scale, exposing this specific internal calculation method at the public API level for a subclass while the parent also has it suggests potential redundancy or confusion about which scale type should be used for decimal calculations. However, given TimeSeriesScale is a distinct scale type, this is likely intentional specialization. A stronger inconsistency is found below.

New (26)

  • Documentation: no build, run or usage example (README.md)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High vulnerability: [GHSA redacted] (pnpm-lock.yaml)
  • Low CVE: [GHSA redacted] (pnpm-lock.yaml)
  • Medium CVE: [GHSA redacted] (pnpm-lock.yaml)
  • Medium CVE: [GHSA redacted] (pnpm-lock.yaml)
  • Medium CVE: [GHSA redacted] (pnpm-lock.yaml)
  • doc comments repeat the names (src/controllers/controller.bar.js)
  • redundant comment (src/core/core.layouts.js)
  • redundant comment (src/core/core.layouts.js)
  • redundant comment (src/helpers/helpers.canvas.ts)
  • redundant comment (src/helpers/helpers.canvas.ts)
  • redundant comment (src/helpers/helpers.canvas.ts)
  • …and 6 more

Written by cca.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 13 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 71d44219e79e3ac41e6f9dc907022eebf574868d — the exact code this score is about.
  • Scored under rubric-2026.11.3 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.61+preprod-f3449e6eb431.