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.
Jens A. Koch
source share