Chartjs-How to setup a basic line chart in React / Next.js with TypeScript?

0👍

You are not registering the category scale, so you will need to import the chart from chartjs itself and register the category scale on there.

import { Line } from 'react-chartjs-2';
import { CategoryScale, Chart } from 'chart.js';

Chart.register(CategoryScale);

Edit
Putted in a PR that clarifies this, link shows how to resolve the error correctly now

Leave a comment