antvis / F2

📱📈An elegant, interactive and flexible charting library for mobile.
https://f2.antv.vision/zh
MIT License
7.89k stars 649 forks source link

chart.interaction is not a function #474

Closed pzcaaa closed 5 years ago

pzcaaa commented 5 years ago

image 我已经引入了 require('@antv/f2/lib/interaction/pan');

F2 Version: 3.1.15 Platform: Mini Showcase(like screenshots): CodePen Link: https://antv.alipay.com/zh-cn/f2/3.x/demo/interaction/pan-for-bar-chart.html

simaQ commented 5 years ago

https://github.com/antvis/f2/blob/master/CHANGELOG.md#320-2018-08-16 请看下 changelog,3.2.0 才开始支持 interaction,请使用 F2 最新版本 3.3.4

a654688383 commented 5 years ago

饼图 引入 也会报这个错 antv/f2/lib/index 还有antv/f2,是不是整合一下啊

alianggitok commented 5 years ago

https://github.com/antvis/f2/blob/master/CHANGELOG.md#320-2018-08-16 请看下 changelog,3.2.0 才开始支持 interaction,请使用 F2 最新版本 3.3.4

我都已经3.4.1了,还是会报这个错:

import F2 from '@antv/f2';
import Interaction from '@antv/f2/lib/interaction/';

let chartInstance = new F2.Chart({
        id: 'myChart',
        pixelRatio: window.devicePixelRatio, // 指定分辨率
        plugins: {Interaction}
});

chartInstance.interaction('pan');
akaxiaok commented 5 years ago

有这个问题的

 import F2 from '@antv/f2/lib/index-all;

凑合用吧