apache / echarts

Apache ECharts is a powerful, interactive charting and data visualization library for browser
https://echarts.apache.org
Apache License 2.0
60.76k stars 19.62k forks source link

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

Open Pat-Ibulaire opened 4 years ago

Pat-Ibulaire commented 4 years ago

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...

echarts-bot[bot] commented 4 years ago

Hi! We've received your issue and please be patient to get responded. 🎉 The average response time is expected to be within one day for weekdays.

In the meanwhile, please make sure that you have posted enough image to demo your request. You may also check out the API and chart option to get the answer.

If you don't get helped for a long time (over a week) or have an urgent question to ask, you may also send an email to dev@echarts.apache.org. Please attach the issue link if it's a technical question.

If you are interested in the project, you may also subscribe our mailing list.

Have a nice day! 🍵

Pat-Ibulaire commented 4 years ago

capture d'écran_3

Pat-Ibulaire commented 3 years ago

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

DaoNguyenTrong commented 2 years ago

I'm having the same problem

kayijyc commented 2 years ago

Same problem here 😞

ob-ARC commented 2 years ago

Having the same problem. I think this is pretty serious and should be addressed with priority!

ob-ARC commented 2 years ago

please also check this example: https://echarts.apache.org/examples/en/editor.html?c=line-simple&code=PYBwLglsB2AEC8sDeAoWsAeBBDEDOAXMmurGAJ4gCmRA5JALZW0A0J6DE0RAjAGwBWAXwAcAZgBMABhky2pWAwCGGXoIEB2PgE4-sue1gr8AGS41iChXgAWwAO5EwAJwCuVeVfQwAWlWfATm5UhgC-nhxcwM4AKhAAxgDWRKhe6Fx4EAAmFgBmSgA2eB6GCoUQAObQAOoQYDYmSgBGVAVB7hFWeCAFdQByrgwtzkQSYZ3dvWBm0BapabYO7SEK4Yac0NEAyj11M3OlpIuOZMHjhsZ4jS1tlla50cpgYP5Eua7Q8ZAwABQAboUOrAuDkMCwyAlEgBKZCwApUMBGAAiSheCFgs3ssBRLx-UIA3MjUVQAHTFMBxJj_QFUAmwZwI1zOOBUeI2JTOMB4EmMUkPZxPH5KHEeWAAIiQAAlJaECEgGAxQmLwS53HS1l5jgBZLjXVrLTrobUqPW3VUlLw2bJUADyf38BSUIGWYRIGtg5Bw-BShgo1DoAIK7lobs8xWcECohFgAG1DPMFH6LLQmhzWId4r1nacOocsqilEQYzH-EJRJJ9FJwTwALrgkvqLS6SvgiQ1mvnBQJ0hJui9WbpryZiDZ82G2D5sCF2MNsviaT6cFiOux0uaHR6RewAAs7dd6Br6BQoXxQA

grafik

vs

grafik

Pretty much unacceptable, no?

ob-ARC commented 2 years ago

Some observations:

hauserkristof commented 2 years ago

Same problem here

gehringf commented 1 year ago

I also ran into this problem :(

bbcfive commented 1 year ago

@pissang @100pah @Ovilia @plainheart @susiwen8 hey, can you guys help to have a look here? thx

jdimmerman commented 1 year ago

Also following up here. This is causing me a lot of pain and I'm unable to find a solution for sparse datasets shown on time-like bar charts with fairly short intervals (eg a week, with a datapoint on 2 or the days)

jinbekim commented 1 year ago

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

ob-ARC commented 9 months ago

Does this relate to #15671? It is mentioned there that the offset on the axis is added to accommodate bar space on axis limits. Nevertheless, I think the min/max label should still be applied to the actual min/max defined on the axis, and not to the extended, artificial min/max values.

ob-ARC commented 9 months ago

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

Does not work for me.

grenobnik commented 1 month ago

I am also struggling with this issue 😫