Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add custom logo to Highchart graphs

Is it possible to add custom logo/images to the graphs?

I have tried to modify the credits label, without luck.

$('#container').highcharts({

    credits: {
        text: 'remisture.no',
        href: 'http://remisture.no',
        position: {
            align: 'right',
            x: -75,
            verticalAlign: 'top',
            y: 25
        },
        style: {
            color: 'red',
            backgroundImage: 'url(https://upload.wikimedia.org/wikipedia/en/thumb/3/3a/Burger_King_Logo.svg/1024px-Burger_King_Logo.svg.png)'
        }
    },

    xAxis: {
        categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
    },

    series: [{
        data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
    }]
});

Demo: http://jsfiddle.net/remisture/738bnv0b/

Any idea how to approach this?

like image 658
Remi Sture Avatar asked Oct 17 '25 12:10

Remi Sture


1 Answers

from their support forum, you can use Renderer.image just as:

$('#container').highcharts({

    // your setup

}, function (chart) { // on complete

    chart.renderer
         .image('//image.com/image.png', 100, 100, 30, 30)
         .add();
});

your example with your image: http://jsfiddle.net/738bnv0b/3/

like image 61
balexandre Avatar answered Oct 19 '25 00:10

balexandre