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

BUG: 数据存在 null 且设置 lineCap: 'round' 以及渐变色 的时候报错 #3109

Closed
1 task
visiky opened this issue Dec 14, 2020 · 5 comments · Fixed by antvis/G#807
Closed
1 task
Assignees
Labels

Comments

@visiky
Copy link
Member

visiky commented Dec 14, 2020

  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

https://riddle.alibaba-inc.com/riddles/b04478ba

Steps to reproduce

https://riddle.alibaba-inc.com/riddles/b04478ba

  • 三个条件:数据存在 null,设置 style: { lineCap: 'round' } 且填充色为渐变色
  • 报错信息: Failed to execute 'createLinearGradient' on 'CanvasRenderingContext2D': The provided double value is non-finite.
Environment Info
g2 4.1.2
System -
Browser -
@visiky visiky changed the title BUG: 数据存在 null 且设置 line Cap 以及渐变色 的时候报错 BUG: 数据存在 null 且设置 lineCap: 'round' 以及渐变色 的时候报错 Dec 14, 2020
@visiky
Copy link
Member Author

visiky commented Dec 15, 2020

@hustcc 有没有思路,为什么会出错哈

@hustcc
Copy link
Member

hustcc commented Dec 15, 2020

报错信息看 null 映射数据为 NaN,然后 渐变色函数没法处理 NaN。

image

@hustcc hustcc added the V4 label Jan 29, 2021
@MiaoJianxue
Copy link

我也遇到了这个问题,请问是怎么解决的阿
Uploading image.png…

@Break-2020
Copy link

有没有能捕获到这个异常或者不让它报错的方法

@hustcc
Copy link
Member

hustcc commented Oct 9, 2021

image

G 中之前对 path 做了 NaN 处理,但是做的不全,还需要处理 Infinity,见 PR:antvis/G#807

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

Successfully merging a pull request may close this issue.

5 participants