Home › forums › Using CanvasJS › Generating pngs of charts on cron job
Tagged: canvasjs, server-side
Hi, I have been looking through CanvasJS and I really like how it looks and functions and would serve most of my needs. However, besides generating charts and graphs to the end user through the website, I also have a cron job written in PHP that crunches database input every few hours, and from that I would like to generate static pngs of charts (mostly line graphs). I’m using a run-of-the-mill jquery website and from how I see it, I can’t think of a way that this would be possible. Am I missing something simple / obvious that will allow me to do it, or is canvasjs really not suited for this?
You can save the chart as image on the server with the help of headless browser like PhantomJS.
Please take a look at this sample PhantomJS project, that captures the chart image from web page and saves it to a particular location. Please refer to instructions.txt file for setup instruction.
You must be logged in to reply to this topic.