Chart.js core.js:6162 ERROR Error: “line” is not a registered controller

We can do this in three ways

  1. By importing:
import { Chart, registerables } from 'chart.js';

and then register all the coponents

Chart.register(...registerables);
  1. finally there is an separate path to do just the above for you, in one line:
import Chart from 'chart.js/auto';
  1. By importing and registering the required part as commented by @Tatyana Molchanova
import { Chart, ChartConfiguration, LineController, LineElement, PointElement, LinearScale, Title} from 'chart.js' 

and then register it in component before instantiating new Chart

Chart.register(LineController, LineElement, PointElement, LinearScale, Title);

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)