I have been trying for some time with little success to be able to load highcharts as a require module. I was wondering if anyone had managed to get this working, or if they had any pointers to get me on the right track?
Thank you
I have been trying for some time with little success to be able to load highcharts as a require module. I was wondering if anyone had managed to get this working, or if they had any pointers to get me on the right track?
Thank you
A minimal example of a recent approach for Highcharts with a module (JSFiddle example):
See this Highcharts documentation for a usage description.
Using the recent use.js plugin is definitely the way to go. Editing third party libs as suggested in my previous answer is a pain for maintainability.
I just got it to work as follows:
Add this at the top:
Add this at the very end:
return window.Highcharts; });
This assumes you have jquery already defined, eg
You can follow this general approach for most third party libraries. For example, I did this for jquery.tmpl.js and knockout.js.
With require.js 2.1.0+ a plugin is not necessary. You can include Highcharts with a shim: