stackblitz中的PrimeNg图表未运行? [英] PrimeNg Chart in stackblitz not running?

查看:60
本文介绍了stackblitz中的PrimeNg图表未运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我第一次尝试使用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图表未运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆