@@ -238,7 +238,7 @@ export interface IChartAccessibility {
238
238
* Use this interface if you'd like to create a plugin
239
239
*/
240
240
export interface IChartPlugin {
241
- beforeInit ?( chartInstance : Chart , options ?: { } ) : void ;
241
+ beforeInit ?( chartInstance : Chart , options ?: { } ) : void ;
242
242
afterInit ?( chartInstance : Chart , options ?: { } ) : void ;
243
243
244
244
beforeUpdate ?( chartInstance : Chart , options ?: { } ) : void ;
@@ -250,32 +250,34 @@ export interface IChartPlugin {
250
250
beforeDatasetsUpdate ?( chartInstance : Chart , options ?: { } ) : void ;
251
251
afterDatasetsUpdate ?( chartInstance : Chart , options ?: { } ) : void ;
252
252
253
- beforeDatasetUpdate ?( chartInstance : Chart , options ?: { } ) : void ;
254
- afterDatasetUpdate ?( chartInstance : Chart , options ?: { } ) : void ;
255
-
253
+ // This is called at the start of a render.
254
+ // It is only called once, even if the animation will run
255
+ // for a number of frames. Use beforeDraw or afterDraw
256
+ // to do something on each animation frame
256
257
beforeRender ?( chartInstance : Chart , options ?: { } ) : void ;
257
258
afterRender ?( chartInstance : Chart , options ?: { } ) : void ;
258
259
260
+ // Easing is for animation
259
261
beforeDraw ?( chartInstance : Chart , easing : string , options ?: { } ) : void ;
260
262
afterDraw ?( chartInstance : Chart , easing : string , options ?: { } ) : void ;
261
263
264
+ // Before the datasets are drawn but after scales are drawn
262
265
beforeDatasetsDraw ?( chartInstance : Chart , easing : string , options ?: { } ) : void ;
263
266
afterDatasetsDraw ?( chartInstance : Chart , easing : string , options ?: { } ) : void ;
264
267
265
- beforeDatasetDraw ?( chartInstance : Chart , easing : string , options ?: { } ) : void ;
266
- afterDatasetDraw ?( chartInstance : Chart , easing : string , options ?: { } ) : void ;
267
-
268
+ // Called before drawing the `tooltip`. If any plugin returns `false`,
269
+ // the tooltip drawing is cancelled until another `render` is triggered.
268
270
beforeTooltipDraw ?( chartInstance : Chart , tooltipData ?: { } , options ?: { } ) : void ;
271
+ // Called after drawing the `tooltip`. Note that this hook will not,
272
+ // be called if the tooltip drawing has been previously cancelled.
269
273
afterTooltipDraw ?( chartInstance : Chart , tooltipData ?: { } , options ?: { } ) : void ;
270
274
275
+ // Called when an event occurs on the chart
271
276
beforeEvent ?( chartInstance : Chart , event : Event , options ?: { } ) : void ;
272
277
afterEvent ?( chartInstance : Chart , event : Event , options ?: { } ) : void ;
273
278
274
- resize ?( chartInstance : Chart , newChartSize : Chart . ChartSize , options ?: { } ) : void ;
279
+ resize ?( chartInstance : Chart , newChartSize : Chart . ChartSize , options ?: any ) : void ;
275
280
destroy ?( chartInstance : Chart ) : void ;
276
-
277
- /** @deprecated Use `afterLayout` instead. */
278
- afterScaleUpdate ?( chartInstance : Chart , options ?: { } ) : void ;
279
281
}
280
282
281
283
/**
0 commit comments