How to add chartjs plugin funnel, plugin in stackb

2019-08-27 20:53发布

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

My Stackbliz URL

1条回答
贼婆χ
2楼-- · 2019-08-27 21:20

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.

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

  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.

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.

查看更多
登录 后发表回答