Topic: Registering custom controller on ChartJS

develcti priority asked 2 years ago


Expected behavior I'm trying to register a custom controller in the ChartJS instance that will be rendered by your Chart directive. I expect to do that inside a constructor but it seems that the controller it's not registered anywhere.

// my component constructor() { Chart.register(CustomController); }

Actual behavior The controller is not registered. https://www.chartjs.org/docs/latest/developers/charts.html

Maybe I'm accessing the wrong Chart global instance? Is it a global variable once chartjs is loaded in Angular?


Arkadiusz Idzikowski staff commented 2 years ago

It looks like there is a problem that we need to fix on our end. I added that to our to-do list. We will need to take a closer look at that and make some additional tests.


develcti priority commented 2 years ago

Ok thank you, please reach me as soon as you fixed it.


Arkadiusz Idzikowski staff answered 2 years ago


We added some improvements to the chart directive in the 4.0.0 update. You should be able to register a custom controller after upgrading to the new version.



Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Resolved

Specification of the issue

  • ForumUser: Priority
  • Premium support: Yes
  • Technology: MDB Angular
  • MDB Version: MDB5 3.0.1
  • Device: macbook
  • Browser: chrome
  • OS: macos
  • Provided sample code: No
  • Provided link: Yes