antvis/G2

饼图容器通过transform:scale缩放后,legend分页器无法点击 #3567

guohongshan posted onGitHub

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

https://g2.antv.vision/zh/examples/interaction/others#pie-legend

Steps to reproduce

1、增加data数据至legend出现分页 2、打开控制台给图标父容器添加样式:transform:scale(0.5) 3、点击分页器 4、发现无法点击

Environment Info
g2 4.1.23
System windows, mac
Browser chrome92

transform:scale后,地图点击事件也是如此, 无法准确获取到点击的地区

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


不建议用scale,你这个效果是可以通过更改width height并配置chat的自适应实现的

posted by wenjingyuer over 3 years ago

不建议用scale,你这个效果是可以通过更改width height并配置chat的自适应实现的

历史原因,是图表的一个祖先元素用了scale。通过width height配置的话,很多组件要适配

posted by guohongshan over 3 years ago
const chart = new Chart({
    supportCSSTransform: true,
});

这样就可以

posted by cnyballk over 3 years ago

Fund this Issue

$0.00
Funded

Pull requests