Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Highcharts Server not loading infile correctly

Tags:

highcharts

I am having difficulty having the export feature to work on my server. I have tried searching and there is not much I can get specifically. I have tried both features and the same error shows up each time. This is the error I am getting

./phantomjs highcharts-convert.js -infile test.js -outfile chart.png

ReferenceError: Can't find variable: $

ERROR: the options variable was not available, contains the infile an syntax error? see ->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

contents of test.js are :

{ xAxis: { categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] }, series: [{ data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4] }] };

I have tried putting it in JSON format but it doesn't seem to be working...

like image 836
Thomas Anh Nguyen Avatar asked May 21 '26 23:05

Thomas Anh Nguyen


1 Answers

I had the exact same error...

Make sure you have 3 important files in the same folder as highcharts-convert.js

  1. highcharts.js -or- highstock.js
  2. highcharts-more.js
  3. jquery.js

Then, update the file names at the top of highcharts-convert.js to match these file names and save it.

var config = {
        /* define locations of mandatory javascript files */
        HIGHCHARTS: 'highcharts.js',
        HIGHCHARTS_MORE: 'highcharts-more.js',
        JQUERY: 'jquery.js',
        TIMEOUT: 2000 /* 2 seconds timout for loading images */
    },

Now you should have no more errors (or at least a different one, ha)

like image 130
seebigs Avatar answered May 24 '26 17:05

seebigs



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!