0๐
I had done it using react-chartjs-2
with great documentation. If anyone also wants to use it, here are the examples.
Thanks to this article 4 Ways to Shrink Your Javascript Bundle by 50%, using the step #4.
0๐
You can import this away:
import {
Chart,
LineController,
LineElement,
LinearScale,
CategoryScale,
PointElement,
} from "chart.js";
Chart.register(
LineController,
LineElement,
LinearScale,
CategoryScale,
PointElement
);
I had already answered this issue on github
- Chartjs-How to fill an array with for loop in Javascript
- Chartjs-Hide data labels chart.js and draw/mark y = 0 with thicker line
Source:stackexchange.com