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

Newly Getting drilldown.js:23 Uncaught TypeError: Cannot read property 'drilldown' of null #5750

Closed
peterfranks opened this Issue Sep 29, 2016 · 5 comments

Comments

Projects
None yet
4 participants
@peterfranks

peterfranks commented Sep 29, 2016

We are pulling drilldown.js directly from code.highcharts.com, and I guess there was an update recently. Now our 2D charts no longer display, and we get this error in our browser:

drilldown.js:23 Uncaught TypeError: Cannot read property 'drilldown' of null

Expected behaviour

Some of our data points are null, and we expect them to simply display no dot on our resulting 2D line graph. This has been working great up until very recently.

Actual behaviour

I suspect this new failure is a result of us setting some of our data points to null, since data does not exist for that particular point. As a result, line 645 of drilldown.src.js gives us a null exception:

if (xData[i] === x && series.options.data[i].drilldown) {

The above line will fail when series.options.data[i] is null (as is occasionally in our data set).

If it was defined using short-circuiting as something like the following, we would not see this error (I have tested this locally with success):

if (series.options.data[i] && xData[i] === x && series.options.data[i].drilldown) {

Live demo with steps to reproduce

http://jsfiddle.net/hilarybray/1b0rxwkg/

Notice the second data point has a null value. The chart does not display. Now change the second data point to have a value (for example, 30). The chart displays.

Affected browser(s)

Chrome and Firefox at least, probably others

@TorsteinHonsi

This comment has been minimized.

Show comment
Hide comment
@TorsteinHonsi

TorsteinHonsi Sep 30, 2016

Collaborator

Fails since v4.2.7.

Collaborator

TorsteinHonsi commented Sep 30, 2016

Fails since v4.2.7.

@alvarezguille

This comment has been minimized.

Show comment
Hide comment
@alvarezguille

alvarezguille Jul 25, 2017

Contributor

@TorsteinHonsi I noticed this was fixed in 5.0.1, would it be possible to get this fix included in 4.2.x? Is there any plan for a new 4.x.x release?

Contributor

alvarezguille commented Jul 25, 2017

@TorsteinHonsi I noticed this was fixed in 5.0.1, would it be possible to get this fix included in 4.2.x? Is there any plan for a new 4.x.x release?

@KacperMadej

This comment has been minimized.

Show comment
Hide comment
@KacperMadej

KacperMadej Jul 25, 2017

Contributor

@alvarezguille Please post a live demo with the version you are using and I could prepare a wrapper workaround for you if you are interested. There's no official plan for a new 4.x.x release.

Contributor

KacperMadej commented Jul 25, 2017

@alvarezguille Please post a live demo with the version you are using and I could prepare a wrapper workaround for you if you are interested. There's no official plan for a new 4.x.x release.

@alvarezguille

This comment has been minimized.

Show comment
Hide comment
@alvarezguille

alvarezguille Jul 25, 2017

Contributor

@KacperMadej this should be enough to reproduce it, it's the "Area with missing points" demo using 4.2.7 and adding the drilldown.js module: http://jsfiddle.net/alvarezg/6hn7qpmz/

Contributor

alvarezguille commented Jul 25, 2017

@KacperMadej this should be enough to reproduce it, it's the "Area with missing points" demo using 4.2.7 and adding the drilldown.js module: http://jsfiddle.net/alvarezg/6hn7qpmz/

@KacperMadej

This comment has been minimized.

Show comment
Hide comment
@KacperMadej

KacperMadej Jul 25, 2017

Contributor

@alvarezguille Here's a workaround with a wrapper that applies the fix from the issue. Demo: http://jsfiddle.net/4q8jyrvm/

Contributor

KacperMadej commented Jul 25, 2017

@alvarezguille Here's a workaround with a wrapper that applies the fix from the issue. Demo: http://jsfiddle.net/4q8jyrvm/

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