testing for using chart js
Use Chart.js in React.
Introduce:
- Chart.js: https://github.com/chartjs/Chart.js
- react-chartjs-2: https://github.com/reactchartjs/react-chartjs-2
- remark-mdx-chartjs: https://github.com/pangelani/remark-mdx-chartjs
Chart.js
Documentation:
https://www.chartjs.org/docs/latest/
We should use the Tree-shaking feature for react-chartjs-2.
A very helpful guide about Chart.js:
https://www.chartjs.org/docs/latest/getting-started/usage.html
react-chartjs-2
Documentation:
https://react-chartjs-2.js.org/
we could code like this:
and result:
And it is tree-shakable.
https://react-chartjs-2.js.org/docs/migration-to-v4/#tree-shaking
remark-mdx-chartjs
https://github.com/pangelani/remark-mdx-chartjs
With this, could write chart in markdown.
But it's not written in TypeScript, and raising a TS7016 error. So raise an issue, and wait for the type definition.