score:7
I have the exact 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
as you see i included the needed files using the -resources option of phantom js, but i still get the 'Can't find variable: Highcharts' Error.
Maybe the resources part helps you?
EDIT: I solved my issue, and yours as well i think.
If you use the command like i described it, it doesn't give you the Highcharts error, BUT it breaks when trying to parse the resources. That is due to a grave error in the current version of the highcharts-convert.js script.
In line 682 they split the arguments, but they use an undefined parameter resources.
fileList = resources.split('\,');
You need to change that to:
fileList = params.resources.split('\,');
It works for me now, i hope it helps you.
score:0
Solution number 2
Create a file called resources.js
with the following contents and place it in the same folder as options.js
. Now you don't need to edit highcharts-convert.js
and it will still work.
{
"files": "highcharts.js"
}
score:0
Hopefully, this might help others. If you're using https for jsfiddle.net then make sure you're including the highcharts library with https too. Otherwise you would get "ReferenceError: Can't find variable: Highcharts" in Safari console(not very helpful). In chrome console, you get a clear message. "Mixed Content: The page at 'https://jsfiddle.net/' was loaded over HTTPS, but requested an insecure script 'http://code.jquery.com/jquery-migrate-1.1.0.js'. This request has been blocked; the content must be served over HTTPS.
For https make sure you have the following in the html window of jsfiddle:
<script src="https://code.highcharts.com/highcharts.js"></script>
score:2
Thank you for the solution @max-uppenkamp. The Highcharts team should integrate this into their code without delay! EDIT: I see you have already notified them: https://github.com/highcharts/highcharts-export-server/issues/18
I note that a command-line as minimal as this will still work:
phantomjs highcharts-convert.js -infile options.json -outfile chart.png -resources highcharts.js
Also, I only need highcharts.js
, highcharts-convert.js
and options.js
in my folder. Seems that I don't need highcharts-more or jquery.
NB. My options.json file looks like this:
{
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]
}]
}
Source: stackoverflow.com
Related Query
- Highcharts and phantomjs error. Can't find variable Highcharts
- Setup of Highcharts and PhantomJS on Windows 7. JSON string parse error
- Using PhantomJS to create HighCharts grahps server side for use in PDF creation (PHP) - results in exit code 11 from PHPs exec();
- Highcharts - Global configuration with common code and unique data & Headings
- Error while adding and removing plotLine on highcharts
- HighCharts Stock Chart error code 18
- How to improve performance of Highcharts and avoid error 15 inspite of sorted data?
- Highcharts error when add and shift data to hidden series
- Highcharts - bubble chart with titles at x- and y-Axis - Error #14
- Highcharts - selection error with live data and different time intervals
- Highcharts error #13 and AngularJs
- phantomjs highcharts > "Can't find variable: $"
- (Very) hard to find Highcharts error
- Uncaught TypeError: Cannot read property '0' of undefined javascript error and with highcharts
- move one vertical line with mouse over and find intersection point with two highcharts
- invalid character error with jquery and highcharts SCRIPT1014: Invalid character
- Converted PHP code that built an array to JS and now highcharts doesn't work - what did I do wrong?
- Using a flask variable as data source for highcharts
- Find and fill intersection of line chart with plot line in highcharts
- Highcharts Javascript - Synchronize Chart and Table not working - Cant read property cell of undefined
- Setting min and max for chart in Highcharts library error
- Passing all data properly and still highcharts throwing error
- Error: Data source must be a URL for refresh | console error | javascript | Highcharts
- highcharts with type scripts and vue, type incompatible error
- Highcharts Error 13 on Ajax Result and Dynamic Div
- Error with PhantomJS when installing Highcharts export server on Azure VM (Ubuntu 20.04)
- how can I use rangeselector and navigation in highcharts in the given code
- Calling Highcharts export to jpeg but the source is https and exporting is http (security warnings issued by browser)
- Laravel Highcharts - Cant set value and labels from arrays
- I cannot pass in a variable into the highcharts function using jquery and pug.
More Query from same tag
- Highcharts Node.js Export Server - gettting output in SVG string
- Highcharts - how to add icons to a label
- highchart feed data from php json
- how to add images when exporting in highcharts?
- Need to remove the empty space to the left of the graph, after I moved the stocktools to the top of the graph in highstocks
- $.each only shows one series highcharts
- Lazy Loading for multiple series unlike multiple points in highcharts
- highchart : create stock chart
- Force-directed graph in Highcharts has lost its lines
- How to implement a gauge solid chart in JSF
- Don`t work animation on highcharts basic line
- HighCharts showing wrong month
- Highcharts-Vue wait for data then update series
- How to load highcharts annotations module in react typescript?
- Highstock: adding serie to candlestick chart
- Bar chart in High chart for indication of value with two colors in each bar where one color is always kept fixed
- Can i add two axis in a spiderweb highcharts and click x-axis label navigate to another page?
- How to create highlight area under curve in high chart?
- Calling a function from highcharts upon clicking the piechart
- Highcharts Data Not Showing on Ajax Call
- Boxplot and columns combined in a single chart with Highcharts.js
- Using HighCharts seriesMapping in data module to read a Total column
- Angular4 Highcharts TypeError using require
- React Highcharts 'forExport' of undefined
- Border on selected series in Stacked Bar charts + High Charts
- Highcharts 2nd yaxis not scaling
- Highstock area chart renders a gap, but there is data
- Exclude a specific series from exporting to csv
- Draw svg file on highchart or inside html tag
- Grouping a stacked bar chart in Highcharts