Skip to content

Commit aa69514

Browse files
authored
docs: update quickstart information (#1128)
1 parent 160c2ce commit aa69514

File tree

2 files changed

+175
-106
lines changed

2 files changed

+175
-106
lines changed

website/docs/index.mdx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,16 @@ Install this library with peer dependencies:
6767
Then, import and use individual components:
6868

6969
```jsx
70-
import { Doughnut } from 'react-chartjs-2';
70+
import { Chart as ChartJS, ArcElement, Tooltip, Legend } from "chart.js";
71+
import { Doughnut } from "react-chartjs-2";
72+
73+
ChartJS.register(ArcElement, Tooltip, Legend);
7174

7275
<Doughnut data={...} />
7376
```
7477

78+
To learn more about importing and registering elements see [tree-shaking](https://react-chartjs-2.js.org/docs/migration-to-v4/#tree-shaking).
79+
7580
:::tip Need an API to fetch data?
7681
Please consider [Cube](https://cube.dev/?ref=eco-react-chartjs), an open-source API for data apps.
7782
:::

0 commit comments

Comments
 (0)