antvis / antvis/G2Plot

柱形图shape:tick,当数据区间特别接近时,悬浮选中区域错误

Open
#3,415 1 comment 0 reactions 1 assignee Claimed by @hustcc View on GitHub
Bug
Dominant language
TypeScript
Stars
2.7k
Forks
591
PR merge metrics
No merged PRs in 30d

Description

### 🐛 Bug description [Please make everyone to understand it]
只有当区间数据, 相差较小, 鼠标悬浮在区间上, 选中区域位置不对
当区间数据, 相等或者相差较大时, 没有问题

> Please provide a link by forking these links [G2Plot](https://codesandbox.io/s/g2plot-issue-template-gzfdq?file=/index.ts) or GitHub repo, a minimal reproduction.

* _Required_ **Link to minimal reproduction**:

### 📷 Step to reproduce
代码如下:

```ts
import { DualAxes } from '@antv/g2plot';

const data = [
{ time: '2019-03', value: [200, 350], count: 800 },
{ time: '2019-04', value: [400, 650], count: 600 },
{ time: '2019-05', value: [150, 150.5], count: 400 },
{ time: '2019-06', value: [100, 450], count: 380 },
{ time: '2019-07', value: [500, 550], count: 220 },
];

const dualAxes = new DualAxes('container', {
data: [data, data],
xField: 'time',
yField: ['value', 'count'],
geometryOptions: [
{
geometry: 'column',
color: '#5B8FF9',
isRange: true,
shape: 'tick'
},
{
geometry: 'line',
color: '#5AD8A6',
lineStyle: {
lineWidth: 2,
stroke: '#5AD8A6',
},
},
],
});

dualAxes.render();
```

### 🏞 Expected result
![image](https://user-images.githubusercontent.com/52788097/206119932-d234a34d-1c29-4e9b-b78e-36af3107a105.png)

### 🚑 Any additional [like screenshots]

* **G2Plot Version**: 2.4.22
* **Platform**:

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.