How to add image in Highcharts Title and subtitle

做~自己de王妃 提交于 2019-12-21 17:20:17

问题


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"
        });

回答1:


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.



来源:https://stackoverflow.com/questions/27817698/how-to-add-image-in-highcharts-title-and-subtitle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!