crookedmicks
Posts: 1
Joined: Wed Feb 01, 2017 10:27 pm

Credits open in new tab

I'm trying to get credits to open in a new tab. The below doesnt work.

credits: {
text: 'Based on surveys between 2012 and 2014. <br>Source: Gallup, Migration Policies in Sync Worldwide, December 18, 2015',
href: 'http://www.gallup.com/poll/187856/migra ... dwide.aspx',
target: 'blank',
position: {
align: 'center',
verticalAlign: 'bottom',
x: -20,
y: -20
}

Thanks!
pawel_d
Posts: 1910
Joined: Thu Jun 02, 2016 10:28 am

Re: Credits open in new tab

Hi crookedmicks,

Try to set Window.open() on credits element onclick event inside the chart load event like it is presented below:

Code: Select all

chart: {
    events:{
        load: function() {
            this.credits.element.onclick = function() {
                window.open('http://www.example.com', '_blank');
            }
        }
    }                
}
API Reference:
https://developer.mozilla.org/en-US/doc ... indow/open
http://api.highcharts.com/highcharts/chart.events.load

Regards.
Paweł Dalek
Highcharts Developer

Return to “Highcharts Cloud”