BarChart bar is moved outside of container and overlaps with yAxis labels.
One-line summary [问题简述]
Scaled bar element is getting to wide and overlaps with yAxis labels. See screenshots
Version & Environment [版本及环境]
- ECharts version [ECharts 版本]: 3.6.1
- Browser version [浏览器类型和版本]: Chrome 59.0.3071.86 (Official Build) (64-bit)
- OS Version [操作系统类型和版本]: macOS Sierra 10.12.5
Expected behaviour [期望结果]
ECharts option [ECharts配置项]
Other comments [其他信息]



xAxis.boundaryGap: true ?
@pissang yes, other xAxis configs:
Data.map(({ data }, index) =>
echarts.util.merge({
type: 'value',
data: data,
minInterval: 5,
splitNumber: 4,
min: 0,
max: maxValue,
gridIndex: index,
axisLine: { onZero: false },
axisTick: { show: false },
axisLabel: {
show: true,
margin: 5,
},
splitLine: { show: false },
showMinLabel: false,
boundaryGap: true,
}, options, true)
)
Can you put the code on the jsfiddle? thanks.
sure, I posted the code here:
http://gallery.echartsjs.com/editor.html?c=xHkwrlhAz-&v=1
If you zoom and scroll to the right, you'll see the orange bar overlaps with yAxis.
Screenshot attached.

Great. Will check it out!
Found you are using time type in xAxis. time axis is continuous and much more like value type. You should use category type xAxis when using bar series. Or use line series instead if you insist on time xAxis.
Thanks, @pissang, changing type to category fixed the issue.
Another option is to use offset for yAxis. Which will move yAxis to left side hence creating more space for bar. You may also need to limit bar width by barMaxWidth in bar series options.

Can you please help me, why bars are overlapping? I am using xAxis.type = time.
any updates?
@pissang @Ovilia : any updates on this ? can we using time as type for XAxis for bar charts in the near future ?
any updates? Having the same issue now. I need the axis to be of type time because the data I'm displaying is coming from an API and is not always evenly spaced (e.g. it can be 1 hour apart for multiple datapoints then suddenly 3 days apart).
Switching the xAxis to category, when the axis should be time, only works if the time difference between each datapoint is evenly spaced.
Using offset and barMaxWidth works for some times, but not others (particularly when there's little data to display).
It'd be awesome if the outside of the chart could be on a different zLevel, for example, so that the bars would just be hidden underneath it when it overflows. I'm thinking of dealing with it by passing the data to the xAxis (e.g. ["2022-01-01T00:00:00.000Z", "2022-01-01T01:00:00.000Z", "2022-01-01T02:00:00.000Z", ...]) so that the "type:category" works, if there are no updates.
Here's what I'm working on for reference:
any updates?
any updates?
any updates?