Forum Discussion
ChartJs How to Include and Consume
I am trying to use this web page to create a Chart.JS webpart.
I am having only one problem when I try to consume the ChartJS object at this line of code:
Hi smithme
JSChart internally depends on jQuery so you have to refer the jQuery also on the externals section and add a dependency to jQuery in JSChart reference in the external section.
Also, in the code you have to use either import or require on jsChart and once you have done all the pre-requisites you should be able to use the method.
Why don't you try using the npm package available for Chart.js? It would be a straight forward method instead of using all the externals section configuration. Please refer the below link
Installation · Chart.js documentation
Hope it helps, please like it or mark it as a solution if it resolves your clarification or issue
-Sudharsan K..
- Sudharsan KSteel Contributor
Hi smithme
JSChart internally depends on jQuery so you have to refer the jQuery also on the externals section and add a dependency to jQuery in JSChart reference in the external section.
Also, in the code you have to use either import or require on jsChart and once you have done all the pre-requisites you should be able to use the method.
Why don't you try using the npm package available for Chart.js? It would be a straight forward method instead of using all the externals section configuration. Please refer the below link
Installation · Chart.js documentation
Hope it helps, please like it or mark it as a solution if it resolves your clarification or issue
-Sudharsan K..