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

Disabling Animations when Updating a Chart #10390

Closed
2 of 3 tasks
ehildebrandtrojo opened this issue Jun 1, 2022 · 2 comments
Closed
2 of 3 tasks

Disabling Animations when Updating a Chart #10390

ehildebrandtrojo opened this issue Jun 1, 2022 · 2 comments

Comments

@ehildebrandtrojo
Copy link

ehildebrandtrojo commented Jun 1, 2022

Documentation Is:

  • Missing or needed?
  • Confusing
  • Not sure?

Please Explain in Detail...

Hello,

I am plotting a line graph and would like to disable the 'pop-up' animation when I add a point to my chart. Looking through the docs, I found the following which seems to address the issue (please let me know if this isn't the fix I'm looking for),

Sometimes when a chart updates, you may not want an animation. To achieve this you can call update with 'none' as mode.

I tried adding mode: 'none' to my options dictionary, but that did not work. Does anyone have any examples/know where I should add mode: 'none' as directed by the docs?

Your Proposal for Changes

Specify where mode as 'none' should be added.

Example

https://www.chartjs.org/docs/latest/developers/updates.html#preventing-animations

@LeeLenaleee
Copy link
Collaborator

LeeLenaleee commented Jun 1, 2022

You will need to pass it as an argument:

chart.update('none');

Example is given here but I guess it might also be beneficial to place it in the updating charts section.

https://www.chartjs.org/docs/latest/developers/api.html#update-mode

@ehildebrandtrojo
Copy link
Author

Oh, I see. Thank you so much! I totally missed that.

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

No branches or pull requests

2 participants