最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - how to add annotation text to a Highcharts chart? - Stack Overflow

programmeradmin4浏览0评论

We'd like to add some textual annotation to the charts we create using Highcharts.js.

Ideally we would like to show the annotation in a pop-up window when you mouse over the chart title or a question-mark next to the chart title.

For example:

<b>Chart Title</b>
<sup>
<a href="#" class="chart-tooltip" title="New Members" data-content="annotation text goes here" data-placement="bottom">?</a></sup>

However, when I pass the above html as the Highcharts chart title text attribute, Highcharts does not display it properly, it in fact displays the html text.

Is it possible to make this work using Highcharts interface? If so, how?

Any other suggestions would be appreciated.

Thanks.

We'd like to add some textual annotation to the charts we create using Highcharts.js.

Ideally we would like to show the annotation in a pop-up window when you mouse over the chart title or a question-mark next to the chart title.

For example:

<b>Chart Title</b>
<sup>
<a href="#" class="chart-tooltip" title="New Members" data-content="annotation text goes here" data-placement="bottom">?</a></sup>

However, when I pass the above html as the Highcharts chart title text attribute, Highcharts does not display it properly, it in fact displays the html text.

Is it possible to make this work using Highcharts interface? If so, how?

Any other suggestions would be appreciated.

Thanks.

Share Improve this question asked May 22, 2012 at 17:55 Jon SnowJon Snow 11.9k9 gold badges72 silver badges82 bronze badges 0
Add a ment  | 

1 Answer 1

Reset to default 6

The following works:

title: {
    useHTML: true,
    text: 'This is <b>bold</b>'
}

The useHtml property doesn't seem to be in the documentation that I can see but it seems to work for me and it also works on labels

发布评论

评论列表(0)

  1. 暂无评论