问题描述
这是我第一次尝试使用 Angular6、Primeng 6 制作 stackblitz 应用程序.我正在尝试用它创建 Primeng 图表.我安装了 Chartjs 并更新了 angular.json 文件,如 Primeng 文档中所述,但它抛出错误,指出未定义 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 图表没有运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!