0

I would like to use this 2 Highcharts plugins:

<script src="http://code.highcharts.com/modules/exporting.js"></script> <script src="http://highslide-software.github.io/export-csv/export-csv.js"></script>

The thing is that in my code I cannot call them from the HTML. I am using javascript define() instead:

I copied the content of the scripts into local files and I am calling them this way:

define(['jquery', 'jquery.spectrum', '../lib/highcharts.js', '../lib/highcharts-exporting.js', '../lib/highcharts-export-csv.js'], function($) {

But it is giving me an error: Uncaught ReferenceError: Highcharts is not defined in the line 23 (last line) of highcharts-exporting.js.

However, if I remove '../lib/highcharts-export-csv.js' it works fine. So, I am able to use the exporting.js file but not the export-csv.js one.

David Torres
  • 1,767
  • 1
  • 16
  • 19

1 Answers1

0

My workaround:

I just pasted the contente of highcharts-exporting.js and highcharts-export-csv.js below the content of highcharts.js.

Consequently my define line is just:

define(['jquery', 'jquery.spectrum', '../lib/highcharts.js'], function($) {

David Torres
  • 1,767
  • 1
  • 16
  • 19
  • If somebody come up with a better solution I'll be more than happy to change the accepted answer (if that is possible). – David Torres Apr 13 '15 at 11:59