Skip to content
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

dataLabels bug in HC 6.2.0? #9247

Closed
drmrbrewer opened this issue Oct 25, 2018 · 2 comments
Closed

dataLabels bug in HC 6.2.0? #9247

drmrbrewer opened this issue Oct 25, 2018 · 2 comments
Assignees

Comments

@drmrbrewer
Copy link

I think this must relate to changes made to add the new feature "Added support for multiple data labels on each single point" in 6.2.0.

I'm getting the error:

Uncaught TypeError: Cannot read property 'options' of undefined

The problem occurs in the following bit of HC code:

each(dataLabels, function (label) {
    var options = label.options; // <---- label is undefined here
    // ...
});

Problem occurs when we somehow get to that part of the code with point.dataLabels being an array including one defined element and another undefined element: [H.SVGElement, undefined].

Problem seems to be confined to areasplinerange type (probably any range type), and can be reproduced in the following jsfiddle:

https://jsfiddle.net/jbhgkze2/

@pawelfus
Copy link
Contributor

pawelfus commented Oct 25, 2018

Hi @drmrbrewer

Thanks for reporting the issue. You are right, it used to work in v6.1: https://jsfiddle.net/BlackLabel/jbhgkze2/5/

Workaround:
Instead of returning null in formatter, return empty string: https://jsfiddle.net/BlackLabel/2pq3fzhg/

@drmrbrewer
Copy link
Author

drmrbrewer commented Oct 25, 2018

I tried returning blank strings already, but the problem is that I am using boxes around the labels, so they appear around the blank labels... see https://jsfiddle.net/2pq3fzhg/1/. Reverting to previous version is fine for now

@TorsteinHonsi TorsteinHonsi self-assigned this Oct 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants