antvis/G2



Do you want to work on this issue?
You can request for a bounty in order to promote it!
【v5】连续型图例在小数精度上滑动失效 #5531
Deathsteps posted onGitHub
问题描述
正常滑动 <img width="699" alt="image" src="https://github.com/antvis/G2/assets/1549118/a8e055b3-cef2-45f8-99b6-562f25b81511">
间隔小数时,滑动失效
- 一下子滑到最左端,然后不能拖回来
- 稍微测了一下,精度在 0.01 级别开始出问题
<img width="705" alt="image" src="https://github.com/antvis/G2/assets/1549118/5f7db522-42a0-4087-ae2a-825e05ce4f9f">
期望结果
连续图例筛选可以正常处理精度,要么就在某个精度下,提示不可筛选
如何重现
官方代码修改
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 版本