I have just configured phantomjs which is working fine. I have it installed in order to create charts from highcharts and include them in automated email through cronjobs, based on user's info.
This will be done in php and right now I have the execution running perfectly. My php is:
exec('/usr/bin/phantomjs myscript.js');
and my test myscript.js is:
var page = require('webpage').create();
page.open('http://github.com/', function() {
page.render('github.png');
phantom.exit();
});
This saves github.png in the same directory so all is good. But I need to do this with highcharts and all the examples I found have static data (with apples, bananas, and all that as filler data). If I need to have this created dynamincally from data stored in a sql table can I use php within the javascript to get the user info?
For example I'd like to do something like below:
...title: {
text: 'Combination chart'
},
xAxis: {
categories: [<? echo $xaxis; ?>]
},...
How can I accomplish this? Am I able to pass paramaters through the exec function in my original php file? Thanks!