From bdef29ebb10b2d8d7f2689ee5038433a01f8b8a2 Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Mon, 20 Jul 2020 12:54:46 -0700 Subject: [PATCH] Fix import statement in docs (#7653) --- docs/docs/getting-started/integration.md | 2 +- docs/docs/getting-started/v3-migration.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/docs/getting-started/integration.md b/docs/docs/getting-started/integration.md index 0cd9bf456..773e1c689 100644 --- a/docs/docs/getting-started/integration.md +++ b/docs/docs/getting-started/integration.md @@ -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); diff --git a/docs/docs/getting-started/v3-migration.md b/docs/docs/getting-started/v3-migration.md index 102808e68..f45c42d06 100644 --- a/docs/docs/getting-started/v3-migration.md +++ b/docs/docs/getting-started/v3-migration.md @@ -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); -- 2.47.2