如何在Highcharts Title和subtitle中添加图像 [英] How to add image in Highcharts Title and subtitle

查看:499
本文介绍了如何在Highcharts Title和subtitle中添加图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Highcharts在图表标题中添加图像。图像没有显示。也没有脚本错误。我怀疑highcharts是否支持标题中的图像。任何帮助将不胜感激。谢谢。事先。

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.

这是参考的小提琴: http: //jsfiddle.net/LHSey/123/

chart.setTitle({
            text: "Testing" + " " + "../images/appendImage.png "
        }, {
            text: "This is a test"
        });


推荐答案

您需要设置 useHTML true ,并将图像作为HTML插入:

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.

这篇关于如何在Highcharts Title和subtitle中添加图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆