echarts
echarts copied to clipboard
[Bug] Bar chart column width with a single data point is extremely wide.
Version
5.5.0
Link to Minimal Reproduction
https://jsfiddle.net/emL5csh3/1/
Steps to Reproduce
- Create a Bar chart with a single data point.
Current Behavior
The column of the single data point is extremely wide and it exceeds the width of its "space" on the xAxis.
Expected Behavior
The width of the column should not exceed the width of its width in the xAxis. So, if I have 10 data ticks on the xAxis and all of them are e.g. 20px, the max width of the column of a single data point should not exceed 20px.
Environment
- OS: macOS Sonoma 14.4
- Browser: Arc
- Framework:
Any additional comments?
No response
Just specify the barWidth if you want a specific one. By default (and because bars are most often used with category axis) echarts will make the bar use all space available.