]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Chart.register instead of Chart.plugins.register (#7753)
authorJukka Kurkela <jukka.kurkela@gmail.com>
Thu, 3 Sep 2020 15:45:57 +0000 (18:45 +0300)
committerGitHub <noreply@github.com>
Thu, 3 Sep 2020 15:45:57 +0000 (11:45 -0400)
docs/docs/developers/plugins.md
docs/docs/getting-started/v3-migration.md
samples/charts/area/analyser.js

index 19bda89d19d3616b7ee2dbe55f90699703f516ed..0e4bb33163e5bf0ed2e3b7a91d4baf7b9d825c9c 100644 (file)
@@ -43,7 +43,7 @@ However, this approach is not ideal when the customization needs to apply to man
 Plugins can be registered globally to be applied on all charts (a.k.a. *global plugins*):
 
 ```javascript
-Chart.plugins.register({
+Chart.register({
     // plugin implementation
 });
 ```
@@ -92,7 +92,7 @@ var chart = new Chart(ctx, {
 To disable a global plugin for a specific chart instance, the plugin options must be set to `false`:
 
 ```javascript
-Chart.plugins.register({
+Chart.register({
     id: 'p1',
     // ...
 });
@@ -106,6 +106,6 @@ var chart = new Chart(ctx, {
 });
 ```
 
- ## Plugin Core API
+## Plugin Core API
 
 Read more about the [existing plugin extension hooks](../jsdoc/IPlugin.html).
index 15ffddc0a12923818767d445459b3b6cdc81d5f6..7cb461098f3df2f399becb4106dbc15c0faefa9b 100644 (file)
@@ -263,6 +263,7 @@ The following properties and methods were removed:
 * `Chart.offsetY`
 * `Chart.outerRadius` now lives on doughnut, pie, and polarArea controllers
 * `Chart.plugins` was replaced with `Chart.registry`. Plugin defaults are now in `Chart.defaults.plugins[id]`.
+* `Chart.plugins.register` was replaced by `Chart.register`.
 * `Chart.PolarArea`. New charts are created via `new Chart` and providing the appropriate `type` parameter
 * `Chart.prototype.generateLegend`
 * `Chart.platform`. It only contained `disableCSSInjection`. CSS is never injected in v3.
index b2db9ab525f5d43053beebe26635c568d4e5c859..5c100541830527007b6dda060ce7f4210cae8f32 100644 (file)
@@ -1,7 +1,7 @@
 'use strict';
 
 (function() {
-       Chart.plugins.register({
+       Chart.register({
                id: 'samples-filler-analyser',
 
                beforeInit: function(chart, options) {