问题
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:
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.
- Go to this link for the RAW version https://raw.githubusercontent.com/YetiForceCompany/chartjs-plugin-funnel/master/dist/chart.funnel.bundled.min.js
- You are then going to have to select all and copy the entire minified raw code.
- 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.
来源:https://stackoverflow.com/questions/52796726/how-to-add-chartjs-plugin-funnel-plugin-in-stackblitz