Open
Description
Describe the bug / 问题描述
更改预设值,X轴的值没问题,但X轴滑动条的数值范围时对时错。
Reproduction link / 复现链接
No response
Steps to Reproduce the Bug or Issue / 重现步骤
复现代码如下,可手动更改start或end值进行测试
import { Chart } from '@antv/g2';
const chart = new Chart({
container: 'container',
height: 300,
});
chart
.cell()
.data({
type: 'fetch',
value: 'https://assets.antv.antgroup.com/g2/seattle-weather.json',
})
.transform({ type: 'group', color: 'max' })
.encode('x', (d) => new Date(d.date).getUTCDate())
.encode('y', (d) => new Date(d.date).getUTCMonth())
.encode('color', 'temp_max')
.style('inset', 0.5)
.scale('color', { palette: 'gnBu' })
.animate('enter', { type: 'fadeIn' })
.slider('y')
.slider('x');
setTimeout(() => {
const start = 4, end = 20;
chart.emit('sliderX:filter', { data: { selection: [[start, end], undefined] }, nativeEvent: false })
}, 1000)
chart.render();
Version / 版本
Please select / 请选择
OS / 操作系统
- macOS
- Windows
- Linux
- Others / 其他
Browser / 浏览器
- Chrome
- Edge
- Firefox
- Safari (Limited support / 有限支持)
- IE (Nonsupport / 不支持)
- Others / 其他