You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make sure to also read the [Chart.js v3 migration guide](https://www.chartjs.org/docs/latest/getting-started/v3-migration.html) since you may be impacted by more general breaking changes due to this new Chart.js version.
8
+
9
+
#### Explicit Plugin Registration
10
+
11
+
As described in the [getting started](getting-started.md#integration), it's now required to manually register this plugin, either globally:
12
+
13
+
```js
14
+
Chart.plugins.register(ChartDeferred);
15
+
```
16
+
17
+
or locally:
18
+
19
+
```js
20
+
newChart('foo', {
21
+
plugins: [ChartDeferred]
22
+
})
23
+
```
24
+
25
+
#### Plugin registration
26
+
27
+
Chart.js v3 changed the way to register plugins and now requires to use `Chart.register(plugin)` instead of `Chart.plugins.register(plugin)`.
28
+
29
+
```js
30
+
import {Chart} from'chart.js';
31
+
importChartDeferredfrom'chartjs-plugin-deferred';
32
+
33
+
Chart.register(ChartDeferred);
34
+
```
35
+
36
+
See [Getting Started > Registration](getting-started.html#registration) for details.
37
+
38
+
#### Default options
39
+
40
+
The plugin default options are now accessible in `Chart.defaults.plugins.deferred.*` instead of `Chart.defaults.global.plugins.deferred.*` and can be modified using:
41
+
42
+
```js
43
+
Chart.defaults.set('plugins.deferred', {
44
+
delay:100,
45
+
// ...
46
+
})
47
+
```
48
+
49
+
### Notes
50
+
51
+
#### Chart.js type declaration <Badgetext="TS only"/>
52
+
53
+
Chart.js v3 now provides TypeScript type declaration files bundled in the npm package so it's **not** anymore required to install the `@types/chart.js` package.
0 commit comments