Skip to content

how can i export a graph to jpg/png file in php on server (no javascript)

YES! You can export the image to either the client side or on the server side. You can even run batches to generate charts from the server to any folder with write permission. 

For complete clientless, we recommend "wkhtml" from https://wkhtmltopdf.org/, and use "wkhtmltoimage" command on the server side.

Basically, you create the chart as usually how you want them to display in the browser, one chart per file. Once done, you can simply use wkhtmltoimage to generate .png files. The charts are never displayed on the client side as the images are straight saved on the server side.

Attached is a screencast of batch exporting phpChart charts on the server side.. all completely WITHOUT a web browser.

phpchart image export without browser with wkhtmltoimage

It is supported in the commercial license.

Feedback and Knowledge Base