noveltytech priority asked 2 years ago

*Expected behavior*use chart component*Actual behavior*Chart is not displayed*Resources (screenshots, code snippets etc.)*ERROR ReferenceError: Chart is not defined


.tsdatasets = [ { label: 'Traffic', data: [2112, 2343, 2545, 3423, 2365, 1985, 987], }, ];

labels = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];

Arkadiusz Idzikowski staff commented 2 years ago

@noveltytech Did you install chartjs library and add imports to the angular.json file?

noveltytech priority commented 2 years ago

Hello Arkadiusz,

I installed chartjs should I import in app.module or angular.json file? could you please provide me the code ?


Arkadiusz Idzikowski staff answered 2 years ago

@noveltytech In angular.json file you need to find an object named after your project and update the scripts array:

 "scripts": [

You also need to import MdbChartModule in your app.module in order to use MdbChartDirective.

Please insert min. 20 characters.


Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.



Specification of the issue

  • User: Priority
  • Premium support: Yes
  • Technology: MDB Angular
  • MDB Version: MDB5 1.0.0
  • Device: mac
  • Browser: firefox
  • OS: big sur
  • Provided sample code: No
  • Provided link: No