Table of contents
react-chart(chart.js)
Check annotation import
You need to import related plug-ins or use afterDatasetsDraw
hook functions to draw markers manually
import Chart from 'chart.js';
import annotationPlugin from 'chartjs-plugin-annotation';
Chart.plugins.register(annotationPlugin);
check version
solve
Bash |
Bash |
If there are still non-basic needs in the future, it is recommended to change to a visualization library
The choice of data visualization library in React - Programmer Sought