13👍
I found the internal documentation of each of the hooks in the code (see Below for a prettified version). Not quite the order, but it can help figuring it out.
Note that some hooks have the same name but they differ in the parameters (you can check those directly in the code:
beforeInit
: Called before initializingchart
.afterInit
: Called afterchart
has been initialized and before the first update.beforeUpdate
: Called before updatingchart
. If any plugin returnsfalse
, the update is cancelled (and thus subsequent render(s)) until anotherupdate
is triggered.afterUpdate
: Called afterchart
has been updated and before rendering. Note that this hook will not be called if the chart update has been previously cancelled.beforeDatasetsUpdate
: Called before updating thechart
datasets. If any plugin returnsfalse
, the datasets update is cancelled until anotherupdate
is triggered. @since version 2.1.5afterDatasetsUpdate
: Called after thechart
datasets have been updated. Note that this hook will not be called if the datasets update has been previously cancelled.beforeDatasetUpdate
: Called before updating thechart
dataset at the givenargs.index
. If any plugin returnsfalse
, the datasets update is cancelled until anotherupdate
is triggered.afterDatasetUpdate
: Called after thechart
datasets at the givenargs.index
has been updated. Note that this hook will not be called if the datasets update has been previously cancelled.beforeLayout
: Called before laying outchart
. If any plugin returnsfalse
, the layout update is cancelled until anotherupdate
is triggered.afterLayout
: Called after thechart
has been layed out. Note that this hook will not be called if the layout update has been previously cancelled.beforeRender
: Called before renderingchart
. If any plugin returnsfalse
, the rendering is cancelled until anotherrender
is triggered.afterRender
: Called after thechart
has been fully rendered (and animation completed). Note that this hook will not be called if the rendering has been previously cancelled.beforeDraw
: Called before drawingchart
at every animation frame specified by the given easing value. If any plugin returnsfalse
, the frame drawing is cancelled until anotherrender
is triggered.afterDraw
: Called after thechart
has been drawn for the specific easing value. Note that this hook will not be called if the drawing has been previously cancelled.beforeDatasetsDraw
: Called before drawing thechart
datasets. If any plugin returnsfalse
, the datasets drawing is cancelled until anotherrender
is triggered.afterDatasetsDraw
: Called after thechart
datasets have been drawn. Note that this hook will not be called if the datasets drawing has been previously cancelled.beforeDatasetDraw
: Called before drawing thechart
dataset at the givenargs.index
(datasets are drawn in the reverse order). If any plugin returnsfalse
, the datasets drawing is cancelled until anotherrender
is triggered.afterDatasetDraw
: Called after thechart
datasets at the givenargs.index
have been drawn (datasets are drawn in the reverse order). Note that this hook will not be called if the datasets drawing has been previously cancelled.beforeTooltipDraw
: Called before drawing thetooltip
. If any plugin returnsfalse
, the tooltip drawing is cancelled until anotherrender
is triggered.afterTooltipDraw
: Called after drawing thetooltip
. Note that this hook will not be called if the tooltip drawing has been previously cancelled.beforeEvent
: Called before processing the specifiedevent
. If any plugin returnsfalse
, the event will be discarded.afterEvent
: Called after theevent
has been consumed. Note that this hook will not be called if theevent
has been previously discarded.resize
: Called after the chart as been resized.destroy
: Called after the chart as been destroyed.
- [Chartjs]-Chart.js – Add text/label to bubble chart elements without using tooltips?
- [Chartjs]-Charts JS: How to set units?
Source:stackexchange.com