From: LeeLenaleee <39033624+LeeLenaleee@users.noreply.github.com> Date: Fri, 13 Nov 2020 12:03:21 +0000 (+0100) Subject: Update v3-migration.md (#8047) X-Git-Tag: v3.0.0-beta.7~44 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=29f887b38cc9e1a4dd1868592356df35d1c02beb;p=thirdparty%2FChart.js.git Update v3-migration.md (#8047) Treeshaking import names for the elements were not updated in the docs when they got changed --- diff --git a/docs/docs/getting-started/v3-migration.md b/docs/docs/getting-started/v3-migration.md index ffdd121f7..4326fd360 100644 --- a/docs/docs/getting-started/v3-migration.md +++ b/docs/docs/getting-started/v3-migration.md @@ -25,9 +25,9 @@ Chart.js 3.0 introduces a number of breaking changes. Chart.js 2.0 was released * Chart.js 3 is tree-shakeable. So if you are using it as an `npm` module in a project, you need to import and register the controllers, elements, scales and plugins you want to use. You will not have to call `register` if importing Chart.js via a `script` tag, but will not get the tree shaking benefits in this case. Here is an example of registering components: ```javascript -import { Chart, LineController, Line, Point, LinearScale, Title } from `chart.js` +import { Chart, LineController, LineElement, PointElement, LinearScale, Title } from `chart.js` -Chart.register(LineController, Line, Point, LinearScale, Title); +Chart.register(LineController, LineElement, PointElement, LinearScale, Title); const chart = new Chart(ctx, { type: 'line',