AJ_
AJ_

Reputation: 3987

High Charts - HTML in label

I created a pie chart with the high charts API. The pie chart has legends (label), and what i would like to do is add some html to the legends. For example, on of the labels for Microsoft, and i would like the legends to have a link with an icon next to its name. I have added the use html feature mentioned in the High Charts doc's but i do not see the icon appearing in the legend. Does anyone know why this is?

Fiddle http://jsfiddle.net/k0utfqbs/3/

    series: [{
        name: 'Brands',
        colorByPoint: true,
        data: [{
            name: 'Microsoft Internet Explorer <a href="https://www.microsoft.com/en-us/" ><span class="glyphicon glyphicon-arrow-left"></span></a>',
            y: 56.33
        }, {
            name: '<a href="https://www.google.com/" >Chrome</a>',
            y: 24.03
        }, {
            name: '<a href="https://www.mozilla.org/en-US/firefox/new/" >Firefox</a>',
            y: 10.38
        }]

Upvotes: 0

Views: 52

Answers (1)

Barbara Laird
Barbara Laird

Reputation: 12717

Add

legend : {
    useHTML : true
},

That tells HighCharts that you would like to use HTML in the legend.

http://jsfiddle.net/k0utfqbs/6/

Upvotes: 2

Related Questions