react-chart数据可视化库中annotationPlugin注释无效

目录

react-chart(chart.js)

检查注释导入

检查版本

 解决

react-chart(chart.js)

检查注释导入

需要导入相关的插件或者使用afterDatasetsDraw钩子函数来手动绘制标记(marker)

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

检查版本

 

 解决

Bash
npm install chart.js@3 --save

Bash
npm install [email protected]--save

如果后续还有非基本需求,推荐换个可视化库

扫描二维码关注公众号,回复: 15465862 查看本文章

React中数据可视化库的选择_参宿7的博客-CSDN博客

猜你喜欢

转载自blog.csdn.net/qq_28838891/article/details/131075684
今日推荐