The annotationPlugin comment in the react-chart data visualization library is invalid

Table of contents

react-chart(chart.js)

Check annotation import

check version

 solve

react-chart(chart.js)

Check annotation import

You need to import related plug-ins or use afterDatasetsDrawhook functions to draw markers manually

import Chart from 'chart.js';
import annotationPlugin from 'chartjs-plugin-annotation';
Chart.plugins.register(annotationPlugin);

check version

 

 solve

Bash
npm install chart.js@3 --save

Bash
npm install [email protected]--save

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

Guess you like

Origin blog.csdn.net/qq_28838891/article/details/131075684