mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-06 12:19:08 +02:00
Fix import statement in docs (#7653)
This commit is contained in:
parent
70c2b07eb2
commit
bdef29ebb1
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user