Chartjs-I'm having problems registering the `category` scale in react-chart-js2

0👍

You will need to also install chart.js and include this two line in your js file:

import Chart from "chart.js/auto";
import { CategoryScale } from "chart.js";

command to install:

npm install chart.js

0👍

Importing registerables as follows solved the issue for me, it might be the same for you :

import { Chart, registerables } from 'chart.js';

Chart.register(...registerables);

Leave a comment