How to install a time adapter for the Chart component?

UI Components for Angular
Post Reply
rhegner
Posts: 3
Joined: 04 Oct 2022, 10:04

04 Oct 2022, 10:45

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!

rhegner
Posts: 3
Joined: 04 Oct 2022, 10:04

06 Oct 2022, 20:30

It's actually really easy. I added

Code: Select all

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

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 4 guests