Page 1 of 1

How to install a time adapter for the Chart component?

Posted: 04 Oct 2022, 10:45
by rhegner
I'm trying to use the Luxon time adapter (https://github.com/chartjs/chartjs-adapter-luxon) with my PrimeNG charts.

The installation instruction of that adapter explain how to use it with the "plain" chart.js component. But it is not clear to me how to register that adapter when using chart.js with the PrimeNG wrapper.

I created a minimal example (with luxon and chartjs-adapter-luxon packages already installed) here:
https://stackblitz.com/edit/angular-ivy ... mponent.ts

Any help would be appreciated!

Re: How to install a time adapter for the Chart component?

Posted: 06 Oct 2022, 20:30
by rhegner
It's actually really easy. I added

Code: Select all

import 'chartjs-adapter-luxon';
in my app.module.ts and now it works :)