[Chartjs]-React-chartjs-2 time adapters, "time" is not a registered scale

29👍

Fixed with importing "TimeScale" from Chart.js module. Then added TimeScale argument to Chart.register function. At the end:

import {Chart, LinearScale, PointElement, Tooltip, Legend, TimeScale} from "chart.js"; 

ChartJS.register(LinearScale, PointElement, Tooltip, Legend, TimeScale); 

These fixed everything.

Leave a comment