问题
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