antvis/G2

Series tooltip 在有元素超出绘制区域的时候,存在偏移 #5789

pearmini posted onGitHub

问题描述

Series tooltip 在有元素超出绘制区域的时候,存在偏移

重现链接

No response

重现步骤

import { Chart } from '@antv/g2';

const chart = new Chart({
  container: 'container',
  autoFit: true,
});

chart
  .line()
  .data({
    type: 'fetch',
    value:
      'https://gw.alipayobjects.com/os/bmw-prod/551d80c6-a6be-4f3c-a82a-abd739e12977.csv',
  })
  .encode('x', 'date')
  .encode('y', 'close')

chart
  .text()
  .style('x', 0)
  .style('y', 0)
  .style('text', 'hello world')
  .style('textAlign', 'end');

chart.render();

预期行为

实际结果如下:

<img src="https://github.com/antvis/G2/assets/49330279/322127be-6037-4ba9-8fc3-d4386a70a209" width=640 />

期望没有红框的距离。

平台

  • 操作系统: [macOS, Windows, Linux, React Native ...]
  • 网页浏览器: [Google Chrome, Safari, Firefox]

屏幕截图或视频(可选)

No response

补充说明(可选)

版本:5.1.7


Fund this Issue

$0.00
Funded

Pull requests