mirror of
https://github.com/chartjs/Chart.js.git
synced 2026-03-07 00:36:50 +01:00
Docs on new plugin callback
This commit is contained in:
@@ -399,7 +399,10 @@ Plugins should derive from Chart.PluginBase and implement the following interfac
|
||||
|
||||
// Easing is for animation
|
||||
beforeDraw: function(chartInstance, easing) { },
|
||||
afterDraw: function(chartInstance, easing) { }
|
||||
afterDraw: function(chartInstance, easing) { },
|
||||
// Before the datasets are drawn but after scales are drawn
|
||||
beforeDatasetDraw: function(chartInstance, easing) { },
|
||||
afterDatasetDraw: function(chartInstance, easing) { },
|
||||
|
||||
destroy: function(chartInstance) { }
|
||||
}
|
||||
|
||||
@@ -288,7 +288,7 @@ module.exports = function(Chart) {
|
||||
this.scale.draw();
|
||||
}
|
||||
|
||||
Chart.pluginService.notifyPlugins('beforeElementDraw', [this, easingDecimal]);
|
||||
Chart.pluginService.notifyPlugins('beforeDatasetDraw', [this, easingDecimal]);
|
||||
|
||||
// Draw each dataset via its respective controller (reversed to support proper line stacking)
|
||||
helpers.each(this.data.datasets, function(dataset, datasetIndex) {
|
||||
@@ -302,7 +302,7 @@ module.exports = function(Chart) {
|
||||
// Finally draw the tooltip
|
||||
this.tooltip.transition(easingDecimal).draw();
|
||||
|
||||
Chart.pluginService.notifyPlugins('afterDraw', [this, easingDecimal]);
|
||||
Chart.pluginService.notifyPlugins('afterDatasetDraw', [this, easingDecimal]);
|
||||
},
|
||||
|
||||
// Get the single element that was clicked on
|
||||
|
||||
Reference in New Issue
Block a user