chartjs / chartjs/chartjs-plugin-datalabels

datalabes plugin doesn't work with ES module

Open
#392 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
920
Forks
507
PR merge metrics
No merged PRs in 30d

Description

I use chartjs in my project and I need to display data on Doughnut. So, I install the plugin of datalabels

`import { Chart , registerables } from 'chart.js';
import { Doughnut } from 'react-chartjs-2';
import ChartDataLabels from 'chartjs-plugin-datalabels';

Chart.register(...registerables, ChartDataLabels)`

But it doesn't work by adding the plugin in register, Igave the following error

` Uncaught Error: Dynamic require of "chart.js/helpers" is not supported
at chartjs-plugin-datalabels.js:7:9
at chartjs-plugin-datalabels.js:8:89
at node_modules/chartjs-plugin-datalabels/dist/chartjs-plugin-datalabels.js (chartjs-plugin-datalabels.js:11:1)
at __require2 (chartjs-plugin-datalabels.js:10:50)
at chartjs-plugin-datalabels.js:1356:3
(anonyme) @ chartjs-plugin-datalabels.js:7
(anonyme) @ chartjs-plugin-datalabels.js:8
node_modules/chartjs-plugin-datalabels/dist/chartjs-plugin-datalabels.js @ chartjs-plugin-datalabels.js:11
__require2 @ chartjs-plugin-datalabels.js:10
(anonyme) @ chartjs-plugin-datalabels.js:1356`

Any help please

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.