问题描述
这是我第一次尝试使用Angular6,Primeng 6制作stackblitz应用程序.我正在尝试用它创建Primeng图表.我安装了Chartjs,还更新了Primeng文档中给出的angular.json文件,但是它抛出错误,表明未定义Chart.谁能帮助我解决此问题.在我的本地设置中,同样的东西可以正常工作.
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.
这里是链接: stackblitz链接
推荐答案
将这两行脚本放在index.html文件中,使其可以在stackblitz中本地运行.
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>
这篇关于stackblitz中的PrimeNg图表未运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!