echarts: Bar chart with time axis doesn't use correct "min" and "max" axis options.

Version

4.9.0

Steps to reproduce

Put the code bellow into Echarts exemple page like https://echarts.apache.org/examples/en/editor.html?c=line-simple

option = {
    yAxis: [
        {
            type: "value"
        },
        {
            gridIndex: 1,
            type: value
        }
    ],
    xAxis: [
        {
            min: 1572883414563,
            max: 1604505814563,
            type: "time"
        },
        {
            min: 1572883414563,
            max: 1604505814563,
            gridIndex: 1,
            type: "time"
        }
    ],
    series: [
        {
            type: "line"
        },
        {
            data: [[1575068400000,89938],[1577746800000,467048]],
            xAxisIndex: 1,
            type: "bar",
            yAxisIndex: 1
        }
    ],
    grid:[{bottom: "54%"},{top: "54%"}],
    dataZoom: [
        {
            realtime: true,
            xAxisIndex: [0,1]
        },
        {
            realtime: true,
            xAxisIndex: [0,1],
            type: "inside"
        }
    ]
}

What is expected?

Min for the two xAxis should be 11-04-2019 (1572883414563 value in option) and Max for the two xAxis should be 11-04-2020 (1604505814563 value in option).

What is actually happening?

Ok for the first xAxis, but not the second. Second axis has 10-22-2019 for Min and 11-18-2020 for Max.


If you set the second series to be type: “line”, the problem does not occur. So it may be a problem with bar series…

About this issue

Most upvoted comments

I had the same problem. but I don’t know why when I set barMaxWidth. just problem solved.

Same problem here 😞

I’m having the same problem

Is there anybody here ? The problem is still present. Thank you