横屏状态设置滚动条后,touch事件方向未变
- Dominant language
- JavaScript
- Stars
- 8k
- Forks
- 637
- PR merge metrics
- No merged PRs in 30d
Description
- [ ] I have searched the [issues](https://github.com/antvis/f2/issues) of this repository and believe that this is not a duplicate.
### Reproduction link
[https://antv-f2.gitee.io/zh/examples/creative/case#landscape](https://antv-f2.gitee.io/zh/examples/creative/case#landscape)
### Steps to reproduce
```
fetch('https://gw.alipayobjects.com/os/antfincdn/Jpuku6k%24q%24/linear-pan.json')
.then(res => res.json())
.then(data => {
const originDates = [];
const originSteps = [];
const firstDayArr = [];
data.forEach(function (obj) {
if (obj.date >= '2018-05-01') {
originDates.push(obj.date);
originSteps.push(obj.steps);
}
if (obj.first) {
firstDayArr.push(obj);
}
});
const chart = new F2.Chart({
id: 'container',
pixelRatio: window.devicePixelRatio
});
chart.source(data, {
release: {
min: 1970,
max: 2010
}
});
chart.line().position('release*count');
chart.point().position('release*count').style({
lineWidth: 1,
stroke: '#fff'
});
// 定义进度条
chart.scrollBar({
mode: 'x',
xStyle: {
backgroundColor: 'transparent',
fillerColor: 'transparent',
offsetY: -2
}
});
chart.interaction('pan');
chart.render();
});
```
| Environment | Info |
|---|---|
| f2 | 3.8.6 |
| System | - |
| Browser | - |
---
我是在官方示例横屏图的页面直接修改的,设置滚动条后,还是竖屏的左右方向滑动才起作用
Contributor guide
Research direction
Start with the linked landscape example and reproduce the behavior using F2 3.8.6, focusing on chart.scrollBar({ mode: 'x' }) together with chart.interaction('pan'). Compare touch direction before and after enabling the scrollbar in landscape orientation. Done means the touch interaction follows the expected landscape direction while panning the chart.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- data-visualization, mobile-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100