highcharts map add image to tooltip

半世苍凉 提交于 2019-12-02 19:37:55

问题


I had trouble to add images to Highmap bubble tooltip when hover over bubbles. Anyone knows how to fix it?

Thanks a lot

Here is an example link. Images added on line 24: http://jsfiddle.net/1jm2yxbq/

tooltip: {
formatter: function () {
return '<img src="http://www.w3schools.com/tags/smiley.gif" width="42" height="42">';
}},

回答1:


You just need to set the useHTML property to true:

tooltip: {
              useHTML: true,
              formatter: function () {
                     return '<img src="http://www.w3schools.com/tags/smiley.gif" width="42" height="42">';
                }
            },

I tested it out on the fiddle and it works fine: http://jsfiddle.net/1jm2yxbq/1/



来源:https://stackoverflow.com/questions/40557751/highcharts-map-add-image-to-tooltip

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