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

绘制线图时第一条数据的 y 轴的值为 null 时,绘制不出来 #22

Closed
dxq613 opened this issue Dec 5, 2017 · 0 comments
Closed
Assignees

Comments

@dxq613
Copy link
Member

dxq613 commented Dec 5, 2017

const data = [
  {x: 1, y: null},
  {x: 2, y: 1},
  {x: 3, y: 2}
];

chart.line().position('x*y');

原因:

  • F2 根据第一条数据的字段值进行类型的判定,如果是 Null 那么无法判定字段类型。

解决方案:

  • 可以手工设置 数据的类型
      chart.source(data, {y: {type: 'linear'});
  • 修改代码,如果判定第一条数据的对应字段值为 null ,则继续往下查找,找到一个非 null 的值
@dxq613 dxq613 self-assigned this Dec 5, 2017
@dxq613 dxq613 closed this as completed Dec 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant