]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Update v3-migration.md (#8047)
authorLeeLenaleee <39033624+LeeLenaleee@users.noreply.github.com>
Fri, 13 Nov 2020 12:03:21 +0000 (13:03 +0100)
committerGitHub <noreply@github.com>
Fri, 13 Nov 2020 12:03:21 +0000 (07:03 -0500)
Treeshaking import names for the elements were not updated in the docs when they got changed

docs/docs/getting-started/v3-migration.md

index ffdd121f74686240e5d4ec1ec5b8a77011f84116..4326fd360454b46082f21115b54b3b48b37ec8a3 100644 (file)
@@ -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',