[Bug] Bar positions on timeline
- Dominant language
- TypeScript
- Stars
- 67.3k
- Forks
- 19.8k
- Avg merge
- 11d 14h
- Merged PRs (30d)
- 8
Description
### Version
5.5.1
### Link to Minimal Reproduction
https://codesandbox.io/p/sandbox/apache-echarts-demo-forked-4vg9mg
### Steps to Reproduce
just open https://codesandbox.io/p/sandbox/apache-echarts-demo-forked-4vg9mg
The bug is reproduced with the xAxis type = time and add any bars.
### Current Behavior
Bars offset totally incorrect!

### Expected Behavior
The bars should be positioned exactly in their positions.
### Environment
```markdown
- OS: Ubuntu 20.04.6
- Browser: Chrome 139.0.7258.127
- Framework: Vue@2
```
### Any additional comments?
[src/layout/barGrid.ts](https://github.com/apache/echarts/blob/513918064ac2a0866433d434dc969220f12b9c1a/src/layout/barGrid.ts#L405-L414)
```
let offset = -widthSum / 2;
each(stacks, function (column, stackId) {
result[coordSysName][stackId] = result[coordSysName][stackId] || {
bandWidth: bandWidth,
offset: offset,
width: column.width
} as BarWidthAndOffset[string][string];
offset += column.width * (1 + barGapPercent);
});
```
if change it to
```
each(stacks, function (column, stackId) {
result[coordSysName][stackId] = result[coordSysName][stackId] || {
bandWidth: bandWidth,
offset: -column.width / 2,
width: column.width
} as BarWidthAndOffset[string][string];
});
```
Everything is working as it should, but it seems that offset is needed for something :)). I have not found a single case where this would be necessary, everything seems to be working well.
If you tell me where this offset curve is needed, I will try to fix it and send you an pull request.
Contributor guide
Assessment
This issue has not been assessed yet.