Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError chart.interval(...).data is not a function #4658

Closed
dragonir opened this issue Feb 15, 2023 · 4 comments
Closed

TypeError chart.interval(...).data is not a function #4658

dragonir opened this issue Feb 15, 2023 · 4 comments

Comments

@dragonir
Copy link

问题描述

按官网在Vue2项目中使用浏览器提示 “TypeError chart.interval(...).data is not a function”,官网任意一个示例在CodesandBox中打开也是同样的报错。

比如:https://codesandbox.io/s/b4pw8x

image

@hustcc
Copy link
Member

hustcc commented Feb 15, 2023

看看你依赖的 G2 版本是什么?

@yaderick
Copy link

看看你依赖的 G2 版本是什么?

"@antv/g2": "^5.0.0-beta.10",

@hustcc
Copy link
Member

hustcc commented Feb 15, 2023

image

我看这依赖是 v4 的。

@hbrls
Copy link

hbrls commented Apr 12, 2023

4.2.10 的语法是:

const chart = new Chart({
    container: CONTAINER_ID,
    width: 600, // 指定图表宽度
    height: 300, // 指定图表高度
});

chart.data(data);

chart.interval().position('genre*sold');

chart.render();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants