Skip to main content

How to fix "... is not a registered scale" error?

As you can see in migration to v4 guide:

v4 of this library, just like Chart.js v3, is tree-shakable. It means that you need to import and register the controllers, elements, scales, and plugins you want to use.

For a list of all the available items to import, see Chart.js docs.

So you should register missed components. For example, if you have Uncaught Error: "category" is not a registered scale. error, you should register CategoryScale:

import { CategoryScale } from "chart.js";

ChartJS.register(CategoryScale);