CJ F
CJ F

Reputation: 835

Include image in highcharts export

As part of my chart there is a custom image in the bottom left corner of my chart with a company logo. When I export the chart (pdf, png, etc) the image disappears. Is there a way to make the image part of the export?

As an example, after defining the chart, I have this code snippet to add the image...

var chart = $('#my_chart').highcharts();
chart.renderer.image('/images/logo.gif',10,360,250,29).add();

Upvotes: 1

Views: 1548

Answers (1)

wergeld
wergeld

Reputation: 14442

The reason this is so is because the state of the chart had changed after it was created. I would move your logo addition up to the chart.events.load area like:

    chart: {
        events: {
            load: function(event) {
                 this.renderer.image('/images/logo.gif',10,360,250,29).add();
            }
        }        
    }

Live demo.

Upvotes: 4

Related Questions