antvis/G2

G2基础饼图显示问题 #3978

raylx posted onGitHub

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

https://g2.antv.vision/zh/examples/pie/basic#labelline@

Steps to reproduce

饼图取消勾选某个事例后,事例标签实际未从页面消失,只是被其他事例覆盖一部分,所以会出现类似重影的bug。 image

Environment Info
g2 4.2.2
System windows
Browser Chrome

<!-- generated by antv-issue-helper. DO NOT REMOVE -->


感谢反馈,这个问题真有点奇怪。解法如下:

const chart = new Chart({
  container: 'container',
  autoFit: true,
  height: 500,
  localRefresh: false, // 增加这里
});

大概能知道是什么问题,底层 G 渲染的时候,会根据变化区域去做按需渲染,然后因为变化区域的大小计算有 0.5px 像素的差别,导致画布上又少量区域没有擦除重新渲染。

posted by hustcc almost 3 years ago

Fund this Issue

$0.00
Funded

Pull requests