Accepted answer

you will get an error in your console if you use something that is not imported. if you want to be sure you just have everything and throw away the benefit of tree-shaking you can use this import and register:

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


or in one line:

import chart from 'chart.js/auto'

for the example to work, the elements that need to be imported and registered are:

  • barcontroller
  • barelement
  • categoryscale
  • tooltip
  • legend

generally speaking for a chart you need its controller so linecontroller for line chart, piecontroller for a pie chart, etc. you need the element so a lineelement and pointelement for line or radar chart, arcelement for pie, doughnut or polar area chart, and barelement for bar chart. and then you need to import the supplied plugins for the title, filler (for area charts), legend, and the tooltip.


it worked for me.

import { chart } from "chart.js";
import * as chartjs from "chart.js";

const controllers = object.values(chartjs).filter(
  (chart) => !== undefined



maybe is a little late, but if you are using npm, you can register everything from chart.js using

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

or, directly:

import chart from 'chart.js/auto';

also, you can see here everything it can be imported for an especific chart, and my answer above:

Related Query