0

I am working in an angular project with ng2-charts and chart.js. When I run the project locally the datalabels are shown project run locally. But when I deploy it in a server the datalabels disappear project run in a server

The console does not show any error message.

The libraries versions are "chart.js": "^2.8.0" "ng2-charts": "^2.2.3"

Any help, thank you for your support

KiraAG
  • 773
  • 4
  • 19

1 Answers1

0

I think you need to import both this js and in this order

    // Import chart js and chartpiecelabel in order
   import 'chart.js';
   import 'chart.piecelabel.js';
Palak Jadav
  • 1,202
  • 1
  • 11
  • 23
  • please add some explanation with your answer, don't just put codes as an answer. thanks – Towkir Jun 10 '19 at 05:31
  • Thanks for your advice. At the end I came across with the solution using import 'chartjs-plugin-datalabels' in my-component.ts – Jose Cerón Jun 17 '19 at 19:09