]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Update auto import in usage docs (#10955)
authorJacco van den Berg <jaccoberg2281@gmail.com>
Sat, 10 Dec 2022 13:39:11 +0000 (14:39 +0100)
committerGitHub <noreply@github.com>
Sat, 10 Dec 2022 13:39:11 +0000 (14:39 +0100)
docs/getting-started/usage.md

index 26df786e276838de2ea15e5b0461489e1dc01b21..acb65cc742cd4bc94f2e51b3266e1e233bc110b3 100644 (file)
@@ -54,7 +54,7 @@ As you can see, Chart.js requires minimal markup: a `canvas` tag with an `id` by
 Lastly, let’s create the `src/acquisitions.js` file with the following contents:
 
 ```jsx
-import { Chart } from 'chart.js/auto'
+import Chart from 'chart.js/auto'
 
 (async function() {
   const data = [
@@ -265,7 +265,7 @@ To create the chart, stop the already running application, then go to `src/index
 Then, create the `src/dimensions.js` file with the following contents:
 
 ```jsx
-import { Chart } from 'chart.js/auto'
+import Chart from 'chart.js/auto'
 import { getDimensions } from './api'
 
 (async function() {
@@ -508,7 +508,7 @@ dist/index.ba0c2e17.js       881 B    63ms
 
 We can see that Chart.js and other dependencies were bundled together in a single 265 KB file.
 
-To reduce the bundle size, we’ll need to apply a couple of changes to `src/acquisitions.js` and `src/dimensions.js`. First, we’ll need to remove the following import statement from both files: `import { Chart } from 'chart.js/auto'`.
+To reduce the bundle size, we’ll need to apply a couple of changes to `src/acquisitions.js` and `src/dimensions.js`. First, we’ll need to remove the following import statement from both files: `import Chart from 'chart.js/auto'`.
 
 Instead, let’s load only necessary components and “register” them with Chart.js using `Chart.register(...)`. Here’s what we need in `src/acquisitions.js`: