Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add image in Highcharts Title and subtitle

I'm trying to add images in chart title using Highcharts.The image doesn't show up.There's no script error as well.I doubt whether highcharts support images in title or not.Any help would be appreciated.Thank you in advance.

Here's the fiddle for reference: http://jsfiddle.net/LHSey/123/

chart.setTitle({
            text: "Testing" + " " + "../images/appendImage.png "
        }, {
            text: "This is a test"
        });
like image 227
Arun Avatar asked Jan 07 '15 10:01

Arun


1 Answers

You need to set useHTML to true, and insert your image as HTML:

chart.setTitle({
    useHTML: true,
    text: "Testing" + " " + "<img src='../images/appendImage.png' alt='' />"
}, {
    text: "This is a test"
});

Working fiddle.

like image 136
Matt Avatar answered Oct 15 '22 22:10

Matt