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

Type Error on combination of export and chart.update() #6007

Closed
rstrietzel opened this Issue Nov 21, 2016 · 5 comments

Comments

Projects
None yet
4 participants
@rstrietzel

rstrietzel commented Nov 21, 2016

Expected behaviour

The chart can be updated and exported multiple times.

Actual behaviour

After an export followed by an update to deactivate the legend on exports clicking anywhere leads to a Type Error: k.setState is not a function.

It's working fine with Highcharts 4.2.2, therefore probably a regression.

Live demo with steps to reproduce

https://jsfiddle.net/jc74psrt/1/

  1. export as png
  2. push the button
  3. clicking anywhere leads to "TypeError: k.setState is not a function"

Affected browser(s)

Firefox, Chrome

@TorsteinHonsi TorsteinHonsi added the Bug label Nov 22, 2016

@TorsteinHonsi

This comment has been minimized.

Show comment
Hide comment
@TorsteinHonsi

TorsteinHonsi Nov 22, 2016

Collaborator

Internal note:
Chart.update didn't exist in v4.2.2.

Collaborator

TorsteinHonsi commented Nov 22, 2016

Internal note:
Chart.update didn't exist in v4.2.2.

@TorsteinHonsi

This comment has been minimized.

Show comment
Hide comment
@TorsteinHonsi

TorsteinHonsi Dec 2, 2016

Collaborator

Observation: We may bypass the error message by checking for button.setState, but the issue then is that the export menu doesn't open the second time, after updating the legend.

Collaborator

TorsteinHonsi commented Dec 2, 2016

Observation: We may bypass the error message by checking for button.setState, but the issue then is that the export menu doesn't open the second time, after updating the legend.

@pawelfus

This comment has been minimized.

Show comment
Hide comment
@pawelfus

pawelfus Dec 2, 2016

Contributor

Internal note:
I think the problem is with the event closures:

We recreate the exporting button with all events, except the event with hide() for the context menu - we still use old button reference, because menu = chart[cacheName] exists (no destroying in destroyExport(), simple test: chart['cache-highcharts-contextmenu'] = null; - will show the new context menu, still with the error. Number of errors per click will increase, because everytime we add a new event).

In destroyExport() we can try to remove event removeMouseUp ("destroy" event for a chart is not called when updating the chart, right?) instead of addEvent(chart, 'destroy', removeMouseUp);. How does it sound?

Contributor

pawelfus commented Dec 2, 2016

Internal note:
I think the problem is with the event closures:

We recreate the exporting button with all events, except the event with hide() for the context menu - we still use old button reference, because menu = chart[cacheName] exists (no destroying in destroyExport(), simple test: chart['cache-highcharts-contextmenu'] = null; - will show the new context menu, still with the error. Number of errors per click will increase, because everytime we add a new event).

In destroyExport() we can try to remove event removeMouseUp ("destroy" event for a chart is not called when updating the chart, right?) instead of addEvent(chart, 'destroy', removeMouseUp);. How does it sound?

@TorsteinHonsi

This comment has been minimized.

Show comment
Hide comment
@TorsteinHonsi

TorsteinHonsi Dec 5, 2016

Collaborator

Sounds like music to my ears 👍

Collaborator

TorsteinHonsi commented Dec 5, 2016

Sounds like music to my ears 👍

@yoderexploder

This comment has been minimized.

Show comment
Hide comment
@yoderexploder

yoderexploder Feb 2, 2017

Hello, any update on this problem?

yoderexploder commented Feb 2, 2017

Hello, any update on this problem?

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