antvis/G2

图例在分页时,跳转第二页点击图例marker ,会使整个图例右移 #3726

RichieChoo posted onGitHub

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

Edit on CodeSandbox

Steps to reproduce

跳转第二页点击图例marker ,会使整个图例右移

Environment Info
g2 4.1.34
System -
Browser -

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


调试了一下,问题是出在图例分页的间距上,每一页的宽度是图例宽度加上设置的间距,而由于最后一页没有间距了,所以渲染的时候宽度就会变窄,造成偏移,目前临时的办法是把间距手动设置为0

chart.legend({
  position: "right",
  flipPage: true,
  itemSpacing: 0 // 手动设置为0,不设置默认是24
});
posted by qiaoyuwen over 3 years ago

Fund this Issue

$0.00
Funded

Pull requests