Accepted answer

Here's a server side solution based on PhantomJS. You can use JSONP to make a cross domain call to

Your chart/visualization need to be accessible from outside. You can pass credential to the URL.

Then you can display image with img tag:

<img src="data:image/png;base64, [base64 data]"/>

It works across browser.


With the information from "Render charts on the server" (from jkraybills answer), I've created this minimal example using a Ajax to get an image of a chart that has not been rendered, and displaying it in an img-tag.


<img id="chart" style="width: 600px;" />


// Regular chart options
var options = {
    title: {
        text: 'My chart'

//URL to Highcharts export server
var exportUrl = '';

//POST parameter for Highcharts export server
var object = {
    options: JSON.stringify(options),
    type: 'image/png',
    async: true

//Ajax request
    type: 'post',
    url: exportUrl,
    data: object,
    success: function (data) {
        // Update "src" attribute with received image URL
        $('#chart').attr('src', exportUrl + data);

As in this JSFiddle demonstration.

The rest of the POST parameter (width, callback...) are in the documentation.


I know this is now an old question, but since it came up #1 for me in a Google search result, I think it's worth mentioning that Highcharts now natively supports a server-side image generation script and it works great.


Here's a hack if you have your heart set on using HighCharts. It uses canvg to parse the SVG into a canvas and then converts the canvas to a PNG.

chart = new Highcharts.Chart({
    chart: {
        renderTo: 'container'
    title: {
        text: ''
    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]        
    navigation: {
        buttonOptions: {
            align: 'center'

canvg(document.getElementById('canvas'), chart.getSVG())
var canvas = document.getElementById("canvas");
var img = canvas.toDataURL("image/png");

document.write('<img src="'+img+'"/>');

Related Query

More Query from same tag