Fix import statement in docs (#7653)

This commit is contained in:
Ben McCann 2020-07-20 12:54:46 -07:00 committed by GitHub
parent 70c2b07eb2
commit bdef29ebb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -25,7 +25,7 @@ var myChart = new Chart(ctx, {...});
Chart.js 3 is tree-shakeable, so it is necessary to import and register the controllers, elements, scales and plugins you are going to use.
```javascript
import Chart, LineController, Line, Point, LinearScale, CategoryScale, Title, Tooltip, Filler, Legend from 'chart.js';
import { Chart, LineController, Line, Point, LinearScale, CategoryScale, Title, Tooltip, Filler, Legend } from 'chart.js';
Chart.register(LineController, Line, Point, LinearScale, CategoryScale, Title, Tooltip, Filler, Legend);

View File

@ -24,7 +24,7 @@ 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, Line, Point, LinearScale, Title } from `chart.js`
Chart.register(LineController, Line, Point, LinearScale, Title);