Chart API methods #8370
-
On the documentation https://www.chartjs.org/docs/latest/developers/api.html there are a few methods that I'm not clear on and am hoping for clarification: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
clearErases the canvas. I don't think there'd be a need to use this externally, but it's been exposed since v2.0.0 so we documented it destroyNeeds to be called when a chart is to be removed. If not, and the canvas is reused, errors will be thrown resetIf you want to re-run the initial chart animations, this will reset to the initial state. I don't think most users call this, but it is exposed for legacy reasons like |
Beta Was this translation helpful? Give feedback.
clear
Erases the canvas. I don't think there'd be a need to use this externally, but it's been exposed since v2.0.0 so we documented it
destroy
Needs to be called when a chart is to be removed. If not, and the canvas is reused, errors will be thrown
reset
If you want to re-run the initial chart animations, this will reset to the initial state. I don't think most users call this, but it is exposed for legacy reasons like
clear