f2shim
一个提供legend高度自适应,tooltip脱离canvas的F2插件
安装
npm install --save f2shim
使用说明
- 创建一个只包含
canvas
元素的div
(如果使用到插件的tooltip需要这么做): - 使用;const chart =id: 'demo'height: 300pixelRatio: windowdevicePixelRatioplugins: f2shim // 引入插件;
配置
- 插件tooltip只有在custom为true下有效,如果自定义tooltip又不需要使用插件的,需要如下配置:chart
- tooltip的方向配置,内部采用popper.js, 其配置都支持, 如设置tooltip溢出的范围元素:chart
- 关掉legend高度自适应,配置autoSize为false:const chart =id: 'demo'height: 300autoSize: falsepixelRatio: windowdevicePixelRatioplugins: f2shim // 引入插件;