I am using highstock library to generate chart on my website. I want to use the same charts in my pdf reports. I found these articles on their website:
http://www.highcharts.com/component/content/article/2-articles/news/52-serverside-generated-charts
I installed phantomjs in C directory and highcharts-convert.js in the same directory as HighStock. In C# I am starting a process to execute phnatom JS. This is the code:
Process process = new Process();
process.StartInfo.WorkingDirectory = "C:\\Phantom JS\\phantomjs-1.9.7-windows";
process.StartInfo.FileName = "phantomjs.exe";
process.StartInfo.CreateNoWindow = true;
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
process.StartInfo.Arguments = "phantomjs highcharts-convert.js -infile options.js -outfile chart-output.png -scale 2.5 -width 300";
process.Start();
These are the contents of options.js (copied from highcharts example)
{
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]
}]
}
}
The process runs but there is no output-chart being generated. How can I find if output chart is generated and if yes then where is it located?