antvis / antvis/G2Plot

双轴图添加slider功能后数据未对齐的问题

Open
#3,616 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
2.7k
Forks
591
PR merge metrics
No merged PRs in 30d

Description

### Discussed in https://github.com/antvis/G2Plot/discussions/3609

Originally posted by **jasonzysun** June 27, 2023
使用版本:v2.4.25


添加Slider前:
929fb5064c6629f60af99f8f46b6e3a
```
dualAxes = new DualAxes('buyDIMView-container', {
data: [data, data],
xField: 'date',
yField: ['payAmount', 'tokenAmount'],
label: {
// 可手动配置 label 数据标签位置
position: 'middle', // 'top', 'bottom', 'middle',
// 配置样式
style: {
fill: '#FFFFFF',
opacity: 0.6
}
},
geometryOptions: [
{
geometry: 'column'
},
{
geometry: 'line',
lineStyle: {
lineWidth: 2
}
}
]
})
```
添加Slider后:
4976d5837fe95ee5378aa96f3630b00
```
dualAxes = new DualAxes('buyDIMView-container', {
data: [data, data],
xField: 'date',
yField: ['payAmount', 'tokenAmount'],
label: {
// 可手动配置 label 数据标签位置
position: 'middle', // 'top', 'bottom', 'middle',
// 配置样式
style: {
fill: '#FFFFFF',
opacity: 0.6
}
},
geometryOptions: [
{
geometry: 'column'
},
{
geometry: 'line',
lineStyle: {
lineWidth: 2
}
}
],
slider: {
start: 0.0,
end: 1.0
}
})
```
同时,刷新页面时有概率出现缩略图宽体未填充完整的情况,此时的双轴图数据是对齐的。
7b0c45de049fe05cd563f93d49c12b7

Contributor guide

Open the contributing guide

Research direction

Reproduce the DualAxes example with identical data arrays and the shown slider configuration, comparing the aligned chart with the misaligned result and the incomplete thumbnail case. No file, test, or code entry point is named in the issue; done means identifying the slider-related alignment problem and preserving matching dual-axis data and a fully rendered thumbnail.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.