New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read property 'charAt' of undefined #5215

Closed
olton opened this Issue Apr 14, 2016 · 6 comments

Comments

Projects
None yet
5 participants
@olton

olton commented Apr 14, 2016

Cannot read property 'charAt' of undefined

hightcharts.js line 11391

change

alignment = options.align.charAt(0) + options.verticalAlign.charAt(0) + options.layout.charAt(0);

to

alignment = (options.align != undefined ? options.align.charAt(0) : "c") + (options.verticalAlign != undefined ? options.verticalAlign.charAt(0) : "c") + (options.layout != undefined ? options.layout.charAt(0) : "c");

Affected browser(s)

Chrome, Firefox, IE, Edge

@pawelfus

This comment has been minimized.

Show comment
Hide comment
@pawelfus

pawelfus Apr 14, 2016

Contributor

Thank you for reporting! Could you post jsfiddle with the issue?

Contributor

pawelfus commented Apr 14, 2016

Thank you for reporting! Could you post jsfiddle with the issue?

@billystalnaker

This comment has been minimized.

Show comment
Hide comment
@billystalnaker

billystalnaker May 10, 2016

Yes, this should be fixed. But a way to get around it is to use legend:{enabled:false} instead of legend:false

billystalnaker commented May 10, 2016

Yes, this should be fixed. But a way to get around it is to use legend:{enabled:false} instead of legend:false

@olton

This comment has been minimized.

Show comment
Hide comment
@olton

olton May 10, 2016

@billystalnaker I agree, but then the error should be more elaborate. Otherwise it is not clear where and what to fix in project.

olton commented May 10, 2016

@billystalnaker I agree, but then the error should be more elaborate. Otherwise it is not clear where and what to fix in project.

@billystalnaker

This comment has been minimized.

Show comment
Hide comment
@billystalnaker

billystalnaker May 10, 2016

Totally, it took me a while to debug. And usually highcharts is good about giving you error messages that you can view on their site. And your code does fix the issue, I tried it as well.

billystalnaker commented May 10, 2016

Totally, it took me a while to debug. And usually highcharts is good about giving you error messages that you can view on their site. And your code does fix the issue, I tried it as well.

@TorsteinHonsi

This comment has been minimized.

Show comment
Hide comment
@TorsteinHonsi

TorsteinHonsi May 11, 2016

Collaborator

Thanks for your comments guys, note that this issue is tagged "pending reply" because we couldn't reproduce it. So it turns out legend: false is the problem.

Live demo

http://jsfiddle.net/highcharts/qkvkdhr3/

Under any circumstance, false is not a valid setting for the legend option, it should be an object. So strictly speaking it is a misconfiguration. But since it's a bit harsh to crash over a misconfiguration, we'll provide a fix.

Collaborator

TorsteinHonsi commented May 11, 2016

Thanks for your comments guys, note that this issue is tagged "pending reply" because we couldn't reproduce it. So it turns out legend: false is the problem.

Live demo

http://jsfiddle.net/highcharts/qkvkdhr3/

Under any circumstance, false is not a valid setting for the legend option, it should be an object. So strictly speaking it is a misconfiguration. But since it's a bit harsh to crash over a misconfiguration, we'll provide a fix.

@billystalnaker

This comment has been minimized.

Show comment
Hide comment
@billystalnaker

billystalnaker commented May 11, 2016

Awesome! Thanks @TorsteinHonsi and @olton !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment