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

HTML DataLabels and refreshing without any cause javascript exception #6418

Dunge opened this issue Feb 27, 2017 · 3 comments

HTML DataLabels and refreshing without any cause javascript exception #6418

Dunge opened this issue Feb 27, 2017 · 3 comments


Copy link

@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

Click the button.

Affected browser(s)



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)

Copy link

@jon-a-nygaard 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
Copy link

@jgunderson-IAS jgunderson-IAS commented Jun 20, 2017

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

Copy link

@TorsteinHonsi 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
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants