PrimeNg Chart in stackblitz not running?

2019-08-26 16:44发布

This is the first time i am trying to make an stackblitz app with Angular6, Primeng 6 . I am trying to create Primeng chart with it. I installed Chartjs and also updated the angular.json file, as given in Primeng documentation but it is throwing error saying Chart is not defined. Can anyone help me to resolve this issue. Same thing is working perfectly in my local setup.

Here is the link: stackblitz link

1条回答
2楼-- · 2019-08-26 17:31

Placing these two script lines in the index.html file allows it to run natively in stackblitz.

<script src="https://github.com/chartjs/Chart.js/releases/download/v2.7.2/Chart.bundle.min.js"></script>
  <script src="https://github.com/chartjs/chartjs-plugin-datalabels/releases/download/v0.4.0/chartjs-plugin-datalabels.min.js"></script>
查看更多
登录 后发表回答