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

Ability to toggle annotation buttons #75

Open
samidabeast opened this issue Jun 5, 2017 · 3 comments
Open

Ability to toggle annotation buttons #75

samidabeast opened this issue Jun 5, 2017 · 3 comments
Labels

Comments

@samidabeast
Copy link

Right now if I want to update the chart to not show the annotation buttons, it does not do anything. Can this be added?

Example of it not working with button calling chart.update();
http://jsfiddle.net/7ddsadLg/

@pawelfus
Copy link
Collaborator

pawelfus commented Jun 6, 2017

Thank you for reporting!

At this moment, chart.update() doesn't change anything in the annotations plugin. Right now you can hide manually each button:

  chart.annotations.buttons.forEach(function (button) {
  		button[0].hide();
  });

Demo: http://jsfiddle.net/7ddsadLg/1/

@pawelfus pawelfus added the bug label Jun 6, 2017
@samidabeast
Copy link
Author

Thank you for the quick response. This workaround works. However, if you start the chart with the buttons not enabled, they never show up.

Example: http://jsfiddle.net/7ddsadLg/2/

@pawelfus
Copy link
Collaborator

pawelfus commented Jun 6, 2017

This is correct, buttons must be rendered so we can hide them. You can use chart.events.load callback to hide them on init.

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

No branches or pull requests

2 participants