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

HTML DataLabels and refreshing without any cause javascript exception #6418

Closed
Dunge opened this Issue Feb 27, 2017 · 3 comments

Comments

Projects
None yet
4 participants
@Dunge

Dunge commented Feb 27, 2017

Me again with another obscure issue.

I use a conditional HTML dataLabels to display an image depending on the value of a point.

Sometimes, when I pass from a chart with dataLabels present to a chart without any, I get a javascript exception:

TypeError: Cannot set property 'onmouseover' of undefined

This only happens on these conditions:

  • DataLabel is set to useHTML: true
  • We had a chart rendered with at least one dataLabels present followed to a "setData()" call changing the values so that no dataLabels is present.
  • We call .update() on the series properties (even if the properties to merge are empty).

Expected behavior

No error

Actual behavior

Exception thrown

Live demo with steps to reproduce

http://jsfiddle.net/gts29eq7/1/

Click the button.

Affected browser(s)

All

Workaround

I know I can return an empty string instead of null in the dataLabels, but this cause massive slowdown with many points.
I can also disable useHTML, but then I can't display pictures.

As a side note, your github new issue template have a typo in "behavior" (behaviour)

@jon-a-nygaard

This comment has been minimized.

Show comment
Hide comment
@jon-a-nygaard

jon-a-nygaard Feb 28, 2017

Collaborator

@Dunge Thanks for reporting, we will fix this as soon as possible.

Internal Note: Fails on Html.js L320 because there is a series.dataLabelGroup but no div element

Collaborator

jon-a-nygaard commented Feb 28, 2017

@Dunge Thanks for reporting, we will fix this as soon as possible.

Internal Note: Fails on Html.js L320 because there is a series.dataLabelGroup but no div element

@jon-a-nygaard jon-a-nygaard self-assigned this Feb 28, 2017

@jon-a-nygaard jon-a-nygaard added the Bug label Feb 28, 2017

@jgunderson-IAS

This comment has been minimized.

Show comment
Hide comment
@jgunderson-IAS

jgunderson-IAS Jun 20, 2017

@jon-a-nygaard Any updates on a fix for this? Thanks!

jgunderson-IAS commented Jun 20, 2017

@jon-a-nygaard Any updates on a fix for this? Thanks!

@TorsteinHonsi

This comment has been minimized.

Show comment
Hide comment
@TorsteinHonsi

TorsteinHonsi Jun 22, 2017

Collaborator

The root cause is that the SVG group has a HTML counterpart, and while the HTML counterpart is deleted, the SVGWrapper's overridden on function is not. The same thing theoretically happens with translateXSetter and translateYSetter. I'll fix this by simply checking for parents[0].div, but a complete fix would require that we restore the original functions when deleting the div in SvgRenderer.js.

Collaborator

TorsteinHonsi commented Jun 22, 2017

The root cause is that the SVG group has a HTML counterpart, and while the HTML counterpart is deleted, the SVGWrapper's overridden on function is not. The same thing theoretically happens with translateXSetter and translateYSetter. I'll fix this by simply checking for parents[0].div, but a complete fix would require that we restore the original functions when deleting the div in SvgRenderer.js.

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