如何在stackblitz中添加chartjs插件漏斗、插件? [英] How to add chartjs plugin funnel, plugin in stackblitz?

查看:91
本文介绍了如何在stackblitz中添加chartjs插件漏斗、插件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 stackblitz 中创建一个 angular6 Primeeng 6 应用程序.我在其中使用 PrimeNg 图表.另外我想添加 use chartjs-plugin-datalabelschartjs-plugin-funnel .我能够使用 ChartJs 和 chartjs-plugin-datalabels,但无法找到如何使用 chartjs-plugin-funnel.Chartjs 漏斗 NPM

I am trying to create an angular6 Primeng 6 app in stackblitz. I am using PrimeNg chart in it. Also I want to add use chartjs-plugin-datalabels and chartjs-plugin-funnel . I am able to ChartJs and chartjs-plugin-datalabels but not able to find how to use chartjs-plugin-funnel. Chartjs funnel NPM

我的 Stackbliz 网址

My Stackbliz URL

推荐答案

更新: 对不起,当我发布最后一个链接时,我不在键盘,我现在在电脑前,有机会玩这一点.这个和其他两个有点不同,因为 YetiForceCompany github 上的发布,当你导航到它们时,url 不会像其他两个一样自动下载缩小的 .js 文件......他们的发布 api 是完整的项目源一个 zip 文件,这在以 url 为 src 的脚本标记中不起作用.

Update: Sorry was away from keyboard when I posted the last link, I am at computer now and had a chance to play with this a bit. This one is a little different from the other two, because the releases on YetiForceCompany github the url's don't automatically download the minified .js file like the other two when you navigate to them... their release api is the complete project source in a zip file and this will not work in a script tag with url as the src.

要使这个在 stackblitz 中工作,您将必须执行以下操作.

For this one to work in stackblitz you are going to have to do the following.

  1. 转到此链接以获取 RAW 版本https://raw.githubusercontent.com/YetiForceCompany/chartjs-plugin-funnel/master/dist/chart.funnel.bundled.min.js
  2. 然后您将不得不全选并复制整个缩小的原始代码.
  3. 然后将包裹在 <script></script> 标签中的整个内容粘贴到您的 index.html 中,不要使用 src... 是的,在打开和关闭脚本标签之间粘贴整个长长的原始代码块.
  1. Go to this link for the RAW version https://raw.githubusercontent.com/YetiForceCompany/chartjs-plugin-funnel/master/dist/chart.funnel.bundled.min.js
  2. You are then going to have to select all and copy the entire minified raw code.
  3. Then paste the entire thing wrapped in a <script></script> tag into your index.html, do not use src... yes, paste the entire long blob of raw code between an open and close script tag.

这应该可以让这个插件从你的 stackblitz 中工作......这个是独一无二的,因为这个插件的 github 版本没有正确设置以在脚本标签的 src 中使用.

This should get this plugin to work from your stackblitz... this one is just unique because the github releases for this plugin are not setup properly to use in the src of a script tag.

这篇关于如何在stackblitz中添加chartjs插件漏斗、插件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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