Closed Remco-Muller closed 2 years ago
When i am trying to include 'chartjs-plugin-datalabels' it tells me 'Cannot read property 'register' of undefined'.
var Chart = new ChartJSNodeCanvas({ width, height, plugins: { requireLegacy: ['chartjs-plugin-datalabels'] } });
Update:
The issue is in new.js at line 173. chartJs.plugins.register(freshRequire_1.freshRequire(plugin));
chartJs.plugins.register(freshRequire_1.freshRequire(plugin));
needs to be replace with chartJs.register(freshRequire_1.freshRequire(plugin));
chartJs.register(freshRequire_1.freshRequire(plugin));
What version of Chart JS are you using?
I'm using Chart.js 3.5.0 and I have the same error.
Try the new v4 version as that now supports chart.js 3.x.x
When i am trying to include 'chartjs-plugin-datalabels' it tells me 'Cannot read property 'register' of undefined'.
var Chart = new ChartJSNodeCanvas({ width, height, plugins: { requireLegacy: ['chartjs-plugin-datalabels'] } });
Update:
The issue is in new.js at line 173.
chartJs.plugins.register(freshRequire_1.freshRequire(plugin));
needs to be replace with
chartJs.register(freshRequire_1.freshRequire(plugin));