echarts icon indicating copy to clipboard operation
echarts copied to clipboard

[Bug] Bar chart column width with a single data point is extremely wide.

Open PJUllrich opened this issue 3 months ago • 1 comments

Version

5.5.0

Link to Minimal Reproduction

https://jsfiddle.net/emL5csh3/1/

Steps to Reproduce

  1. Create a Bar chart with a single data point.

Current Behavior

CleanShot 2024-04-15 at 10 19 41@2x

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

PJUllrich avatar Apr 15 '24 08:04 PJUllrich

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.

MatthiasMert avatar Apr 15 '24 11:04 MatthiasMert