G2Plot icon indicating copy to clipboard operation
G2Plot copied to clipboard

🐛 [BUG]堆叠柱状图tooltip位置出现偏移的问题

Open cooper1x opened this issue 1 year ago • 1 comments

🐛 Bug description [Please make everyone to understand it]

Please provide a link by forking these links G2Plot or GitHub repo, a minimal reproduction. 图表容器设置css transform scale缩放后,鼠标悬停tooltip位置会出现偏移。

  • Required Link to minimal reproduction:

📷 Step to reproduce

https://g2plot.antv.vision/zh/examples/column/stacked#basic 任意一个示例,打开Chrome Devtool,在container上加一行代码:

transform:scale(0.8)

image

🏞 Expected result

无论容器怎么加scale,鼠标悬停位置即是tooltips显示位置,比如echarts这个柱图 https://www.makeapie.cn/echarts_content/xSJJXiE1Wx.html image

🚑 Any additional [like screenshots]

  • G2Plot Version:latest
  • Platform:macOS Chrome Dev 105.0.5148.2(正式版本)dev (x86_64)

cooper1x avatar Jul 11 '22 08:07 cooper1x

🐛 Bug description [Please make everyone to understand it]

Please provide a link by forking these links G2Plot or GitHub repo, a minimal reproduction. 图表容器设置css transform scale缩放后,鼠标悬停tooltip位置会出现偏移。

  • Required Link to minimal reproduction:

📷 Step to reproduce

https://g2plot.antv.vision/zh/examples/column/stacked#basic 任意一个示例,打开Chrome Devtool,在container上加一行代码:

transform:scale(0.8)

image

🏞 Expected result

无论容器怎么加scale,鼠标悬停位置即是tooltips显示位置,比如echarts这个柱图 https://www.makeapie.cn/echarts_content/xSJJXiE1Wx.html image

🚑 Any additional [like screenshots]

  • G2Plot Version:latest
  • Platform:macOS Chrome Dev 105.0.5148.2(正式版本)dev (x86_64)

我也遇到了这个问题,请问您解决了吗 @cooper1x

xueli327426 avatar Jul 28 '22 06:07 xueli327426

请移步至 https://github.com/antvis/G2Plot/issues/1160

rskmin avatar Feb 22 '23 01:02 rskmin

import { Column } from '@antv/g2plot';

const stackedColumnPlot = new Column('container', {
  data,
+ supportCSSTransform: true,
  isStack: true,
  xField: 'year',
  yField: 'value',
  // ...
});

image

hustcc avatar Feb 22 '23 01:02 hustcc