Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to add annotation text to a Highcharts chart?

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.

like image 236
Zack Xu Avatar asked May 22 '12 17:05

Zack Xu


1 Answers

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

like image 133
Chris Avatar answered Oct 28 '22 22:10

Chris