antvis/G2




Do you want to work on this issue?
You can request for a bounty in order to promote it!
【v5】多轴图缩略轴拖动时图形渲染异常 #5242
Deathsteps posted onGitHub
问题描述
- 只配一个 X 轴的 slider, 拖不动
- 两个图 X 轴都配,滑动显示异常
- 配 Y 轴,也有相同问题
滑动前 <img width="701" alt="image" src="https://github.com/antvis/G2/assets/1549118/acd5062c-fb24-4e26-84d7-6ef39019ea9d">
滑动后 <img width="688" alt="image" src="https://github.com/antvis/G2/assets/1549118/a52cfb2b-bbbc-4639-94ab-e86ce0ce8209">
期望结果
问题1 我觉得,如果不能拖,是不是不显示比较好。 问题 2、3 应该是同一根源,滑动过程中应该正确显示范围内的图。
如何重现
官方代码修改
import { Chart } from '@antv/g2';
const data = [
{ time: '10:10', call: 4, waiting: 2, people: 2 },
{ time: '10:15', call: 2, waiting: 6, people: 3 },
{ time: '10:20', call: 13, waiting: 2, people: 5 },
{ time: '10:25', call: 9, waiting: 9, people: 1 },
{ time: '10:30', call: 5, waiting: 2, people: 3 },
{ time: '10:35', call: 8, waiting: 2, people: 1 },
{ time: '10:40', call: 13, waiting: 1, people: 2 },
];
const chart = new Chart({
container: 'container',
theme: 'classic',
autoFit: true,
});
chart.data(data);
chart
.interval()
.encode('x', 'time')
.encode('y', 'waiting')
.axis('y', { title: 'Waiting', style: { titleFill: '#5B8FF9' } })
.slider('x', {})
// .slider('y', {});
chart
.line()
.encode('x', 'time')
.encode('y', 'people')
.encode('shape', 'smooth')
.style('stroke', '#fdae6b')
.style('lineWidth', 2)
.scale('y', { independent: true })
.axis('y', {
position: 'right',
grid: null,
title: 'People',
style: {
titleFill: '#fdae6b',
},
})
.slider('x', {})
// .slider('y', {});
chart.render();
额外信息
- G2 5.0.13 版本