-
Notifications
You must be signed in to change notification settings - Fork 19.8k
Open
Labels
bugenThis issue is in EnglishThis issue is in EnglishpendingWe are not sure about whether this is a bug/new feature.We are not sure about whether this is a bug/new feature.
Description
Version
5.6.0
Link to Minimal Reproduction
Steps to Reproduce
- Create a bar chart using Apache ECharts with a time-based xAxis.
- Use two data points that are only a few hours apart.
- Render the chart without barWidth and observe the xAxis padding (minimal, a few hours).
- Add barWidth: "90%" to the bar series.
- Re-render the chart and observe that the xAxis min/max expand by multiple days.
option = {
xAxis: {
type: 'time',
},
yAxis: {
type: 'value'
},
series: [
{
type: 'bar',
barWidth: '90%',
data: [
[1768428600000, 1],
[1768466400000, 1],
],
}
]
};
Current Behavior
When barWidth is explicitly set on a bar series using a time xAxis, ECharts significantly expands the computed xAxis range (min/max), resulting in several days of padding before and after the actual data points.
This does not happen when barWidth is omitted.
Expected Behavior
Setting barWidth should only affect the visual width of bars and must not influence the xAxis min/max calculation.
The xAxis range and padding should remain consistent with the default behavior when barWidth is not specified.
Environment
- OS:
- Browser:
- Framework:Any additional comments?
No response
Metadata
Metadata
Assignees
Labels
bugenThis issue is in EnglishThis issue is in EnglishpendingWe are not sure about whether this is a bug/new feature.We are not sure about whether this is a bug/new feature.