chart.js——options下的interaction的交互学习笔记

598 阅读1分钟

首先先放上整体架构

   interaction---[
       mode
       axis
       intersect  
   ]
   

intersect //boolean 为true时,只有在鼠标触碰到图上的点时才会出发交互效果 为false时,会根据mode的参数判断交互效果

   mode---[
       point  触发与该点相交的交互
       nearest  触发计算出的最近的点上有关最近的线的交互效果
       index  触发计算出的最近的点上全部的交互效果
       dataset 触发计算出的最近的线上的所有数据
       x
       y
   ]

axis //计算最近的线的配置 参数 x y xy 默认为'x'->'index' 和'xy'->'dataset'nearest'模式。

保存几个chart.js的学习网站

GIT BOOK
https://chartjs.bootcss.com/docs/charts/scatter.html

Chart.js 学习笔记
https://my.oschina.net/NamiZone/blog/1577250

chart.js3.3.2
https://www.chartjs.org/docs/latest/getting-started/

chart.js中文网
https://www.cnblogs.com/CraryPrimitiveMan/p/3469271.html