Progs
Progs

Reputation: 737

How to add image/icon to a chart in Highcharts

I have some charts with their respective categories and those categories have a representative icon, There is way to add an icon/image over the chart in title section or nearby?

I tried to use this code on the title definition but it didn't work, only works when adding images to top of chart on every column.

useHTML: true,
            formatter: function () {
                return '<img src="./img/statics.png"><img>';
            }

i tried to put the image code on the div but looks like the code gets overridden by highcharts.

Upvotes: 0

Views: 3647

Answers (1)

Nishith Kant Chaturvedi
Nishith Kant Chaturvedi

Reputation: 4769

Use below function after chart

 chart.setTitle({
        useHTML: true,
        text: '<img src="./img/statics.png"/>';
        });

See the fiddle here , I used a website's logo in title.

Upvotes: 1

Related Questions