Skip to main content

Quick Tip: Highcharts credit in a new window

Here is a great fiddle by Torstein Hønsi, that shows how to have highcharts credits open in a new window/tab.

Note: if you are using for free, you MUST re-add the text highcharts.com (in place of your domain). If their domain is not seen, you will be against the license.

// code by: Torstein Hønsi: //jsfiddle.net/G9h8z/1/embed/
$(function () {
    $('#container').highcharts({
        chart: {
            events:{
                load: function() {
                    this.credits.element.onclick = function() {
                        window.open(
                          'http://www.example.com',
                          '_blank' // <- This is what makes it open in a new window.
                        );
                     }
                }
            }
        },

        credits: {
            text: 'Example.com'
        },

        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]
        }]
    });
});

Resources: