sreeharsha27
Posts: 49
Joined: Tue Dec 03, 2019 5:14 am

Issues with credits property in highcharts

Thu Jun 10, 2021 6:39 pm

Hello,

I don't know if I can do a demo for this issue.

I have a HighchartWrapper.js component where I have defined the credits property to be like this:

credits: {
enabled: true,
text: 'XXX',
style: {
color: '#3a3a3a',
opacity: '0.3',
},
},

The I have a different chart component where I use this HighchartWrapper inside which I have this defined (Notice the events where I have defined the link)

chart: {
type: 'column',
height: 250,
zoomType: 'xy',
panning: true,
panKey: 'shift',

style: {
fontFamily: 'Source Sans Pro',
},
events: {
load: function () {
this.credits.element.onclick = function () {
window.open('https://www.google.com', '_blank');
};
},
},
},

What it does is, when I render the chart on the UI, it gives me a text below the chart called 'XXX' which should redirect me to the link https://www.google.com in a separate tab / window

What is happening is:
1) It is opening up google.com in a different tab as expected
2) ISSUE: At the same time, it also redirects my current window (UI where I am displaying the chart) to : https://www.highcharts.com/?credits

Please advice, thank you !

pawelys
Posts: 889
Joined: Wed Sep 02, 2020 10:37 am

Re: Issues with credits property in highcharts

Fri Jun 11, 2021 6:50 am

Hello! Thanks for contacting us with your question! I tried to reproduce the issue, but everything works like expected. https://jsfiddle.net/BlackLabel/vwbj0rzc/

Could you try to reproduce it?
Kind regards,
Paweł Lysy
Highcharts Developer

sreeharsha27
Posts: 49
Joined: Tue Dec 03, 2019 5:14 am

Re: Issues with credits property in highcharts

Mon Jun 14, 2021 9:48 pm

Well, with a new demo, yes it works.

The info that I can give on top of what I have already given is the version of highcharts that I am using

"highcharts": "9.1.0",
"highcharts-react-official": "3.0.0",

Wondering if there are any known issues.

Unfortunately, we cannot create a demo for this

pawelys
Posts: 889
Joined: Wed Sep 02, 2020 10:37 am

Re: Issues with credits property in highcharts

Wed Jun 16, 2021 6:36 am

OK, so I guess, that you need to additionally add the

Code: Select all

  credits: {
href: ''
        },
snippet, and then it should work :) Let me know if that works for you! Kind regards,
Paweł Lysy
Highcharts Developer

sreeharsha27
Posts: 49
Joined: Tue Dec 03, 2019 5:14 am

Re: Issues with credits property in highcharts

Wed Jun 16, 2021 1:46 pm

Great, thank you, appreciate your response

pawelys
Posts: 889
Joined: Wed Sep 02, 2020 10:37 am

Re: Issues with credits property in highcharts

Thu Jun 17, 2021 8:02 am

You're welcome! In case of any further questions feel free to contact us again! Kind regards,
Paweł Lysy
Highcharts Developer

Return to “Highcharts Usage”