Skip to content

Error when try to disable a plotly_relayout event #94

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

Closed
kchaengsiri opened this issue Jan 7, 2020 · 1 comment
Closed

Error when try to disable a plotly_relayout event #94

kchaengsiri opened this issue Jan 7, 2020 · 1 comment

Comments

@kchaengsiri
Copy link

I have followed the FAQ on how to disable events but I got the error of

ERROR TypeError: Cannot read property 'on' of undefined

@andrefarzat Would you please suggest to me what to do?

here is my code:
component.ts

const chart = this.plotlyService.getInstanceByDivId(divId);
chart.on('plotly_relayout', () => false);

component.html

<plotly-plot [divId]="'c1'" [data]="data" [layout]="layout" (relayout)="onRelayout($event)" (doubleClick)="onRelayout($event)"></plotly-plot>

I'm using

  • Angular: ^6.1.10
  • angular-plotly.js: ^1.3.2
  • plotly.js: ^1.51.3

Thank you

@kchaengsiri
Copy link
Author

I found the mistake. the "divId" which generated by another function is not correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant