Error Highcharts and phantomjs. Cannot find Highcharts variables

I am trying to create multiple server maps using Highcharts and phantomjs , but the following message continues to appear:

Unable to find Highcharts variables.

I know there are similar questions here, but none of them helped me. I am using Windows, with phantomjs 2.1.1, Highcharts 4.2.5

error image

Here is the options.js file:

{
  infile: {
            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]
                }]
          },
          callback: function(chart){
          chart.renderer
               .arc(200,150,100,50,-Math.PI,0)
               .attr({fill:'#FCFFC5',stroke:'black','stroke-width':1})
               .add();
          },
 constr: "Chart",
 outfile: "//tmp//chart.png"
}

And the highcharts-convert.js configuration options:

var config = {
        HIGHCHARTS: 'highcharts.js',
        JQUERY: 'jquery-1.9.1.min.js',
        TIMEOUT: 5000 /* 5 seconds timout for loading images */
    },

Has anyone solved this problem?

+4
source share
4 answers

I have the same problem, although my command looks a bit different:

phantomjs  highcharts-convert.js -infile delete_this.json -outfile /home/max/BLA.png -width 300 -constr Chart -resources highcharts.js,jquery.js

, , -resources phantom js, " : Highcharts".

, ?

: , .

, , Highcharts, . ​​ highcharts-convert.js script.

682 , undefined.

fileList = resources.split('\,');

:

fileList = params.resources.split('\,');

, , .

+5

@max-uppenkamp. Highcharts ! EDIT: , : https://github.com/highcharts/highcharts-export-server/issues/18

, , , :

phantomjs highcharts-convert.js -infile options.json -outfile chart.png -resources highcharts.js

, highcharts.js, highcharts-convert.js options.js . , highcharts-more jquery.

NB. options.json :

{ chart: { type: 'bar' }, title: { text: 'Fruit Consumption' }, xAxis: { categories: ['Apples', 'Bananas', 'Oranges'] }, yAxis: { title: { text: 'Fruit eaten' } }, series: [{ name: 'Jane', data: [1, 0, 4] }, { name: 'John', data: [5, 7, 3] }] }

+1

№ 2

resources.js , options.js. highcharts-convert.js, .

{
    "files": "highcharts.js"
}
0

, . https jsfiddle.net, , highcharts https. "ReferenceError: : Highcharts" Safari ( ). . " : https://jsfiddle.net/ ' HTTPS, script' http://code.jquery.com/jquery-migrate-1.1.0.js '. , HTTPS.

https , html- jsfiddle :

<script src="https://code.highcharts.com/highcharts.js"></script>
0

All Articles