How to open a circulation of tall chart URLs in a new tab

How to make highcharts url tabs open in a new tab?

 credits: { enabled: true, text: 'text', href: 'url' }, 
+8
javascript highcharts
source share
3 answers

You can override the credit click handler after the chart is drawn in the chart loading event:

  chart: { events:{ load: function() { this.credits.element.onclick = function() { window.open( 'http://www.example.com', '_blank' ); } } } }, 

Fiddle here .

+12
source share

http://jsfiddle.net/ptasdfmk/

 // Plugin to add support for credits.target in Highcharts. Highcharts.wrap(Highcharts.Chart.prototype, 'showCredits', function (proceed, credits) { proceed.call(this, credits); if (credits.enabled && this.credits) { this.credits.element.onclick = function () { // dynamically create an anchor element and click it // use the settings defined in highcharts (credits.target) var link = document.createElement('a'); link.href = credits.href; link.target = credits.target; link.click(); } } }); $('#container').highcharts({ credits: { enabled: true, text: 'CREDITS', href: 'http://example.com', target: '_blank' }, }); 

Using the Highcharts configuration (credits section for the purpose), a new link element is created on the fly and is clicked when you click CREDITS. Related events. This allows you to reuse the code and act on the basis of configuration.

+2
source share

Here is a solution that worked for me.

 credits: { enabled: true, text: 'text', href: 'javascript:window.open("http://www.example.com/", "_blank")' }, 
+1
source share

All Articles