I’m using CanvasJS within a SPFx SharePoint Online WebPart. And have issues properly loading and using it as a jQuery Plugin.
After loading jQuery 3.3.1 and jQueryUI 1.12.1, I’m loading the jquery.canvasjs.min.js.
In the browser console I see the message “CanvasJS is not defined”. I checked the jQuery object and jQuery.fn.CanvasJSChart exists, but window.CanvasJS does not.
Do you have ideas how to figure out the issue?
I’m not able to reproduce ist on jsfiddle. It seems to be an issue in combination with a SharePoint environment.
If you provide a email I can invite you to a site where you can reproduce it.
Please check this stackoverflow thread where it says pure JS also works with SPFx. Can you kindly include jquery.canvasjs.min.js and check if that works fine in your case. Incase if you have included jquery.canvasjs.js, kindly include canvasjs.js along with jquery.canvasjs.js.