【v5】连续型图例在小数精度上滑动失效
- Dominant language
- TypeScript
- Stars
- 12.6k
- Forks
- 1.7k
- PR merge metrics
- No merged PRs in 30d
Description
## 问题描述
正常滑动
间隔小数时,滑动失效
* 一下子滑到最左端,然后不能拖回来
* 稍微测了一下,精度在 0.01 级别开始出问题
## 期望结果
连续图例筛选可以正常处理精度,要么就在某个精度下,提示不可筛选
## 如何重现
官方代码修改
```javascript
import { Chart } from '@antv/g2';
const data = [
{ time: '10:10', call: 4, waiting: 2, people: 0.2 },
{ time: '10:15', call: 2, waiting: 6, people: 0.3 },
{ time: '10:20', call: 13, waiting: 2, people: 0.5 },
{ time: '10:25', call: 9, waiting: 9, people: 0.1 },
{ time: '10:30', call: 5, waiting: 2, people: 0.3 },
{ time: '10:35', call: 8, waiting: 2, people: 0.1 },
{ time: '10:40', call: 13, waiting: 1, people: 0.2 },
];
const chart = new Chart({
container: 'container',
autoFit: true,
});
chart.data(data);
chart
.interval()
.encode('x', 'time')
.encode('y', 'waiting')
.encode('color', 'people')
.axis('y', { title: 'Waiting', titleFill: '#5B8FF9' });
chart.render();
```
## 额外信息
* G2 5.1.1 版本
Contributor guide
Research direction
Start with the provided Chart reproduction using a continuous color legend and decimal values such as 0.1–0.5. Trace the continuous-legend filtering and precision handling from that entry point. Done means dragging the legend works with small decimal intervals, or the unsupported precision is clearly reported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 50/100