Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calendar heatmap horizontal: error when computers sets with timezone UTC < -3 #6543

Closed
brunolajoie opened this issue Aug 29, 2017 · 2 comments

Comments

@brunolajoie
Copy link

One-line summary [问题简述]

Echarts calendar heat map does not work on client's browsers when their computers are set to a timezone of UTC -3 or below (for instance, in the US). Error: "Uncaught TypeError: Cannot read property '0' of undefined"

Version & Environment [版本及环境]

Expected behaviour [期望结果]

Normal display of the chart

ECharts option [ECharts配置项]

option = {
tooltip: {
        position: 'top'
    },
    visualMap: {
        min: 0,
        max: 1000,
        calculable: true,
        orient: 'horizontal',
        left: 'center',
        top: 'top'
    },

    calendar: [
    {
        range: '2017',
        cellSize: ['auto', 20]
    },
    {
        top: 260,
        range: '2016',
        cellSize: ['auto', 20]
    },
    {
        top: 450,
        range: '2015',
        cellSize: ['auto', 20],
        right: 5
    }],

    series: [{
        type: 'heatmap',
        coordinateSystem: 'calendar',
        calendarIndex: 0,
        data: getVirtulData(2017)
    }, {
        type: 'heatmap',
        coordinateSystem: 'calendar',
        calendarIndex: 1,
        data: getVirtulData(2016)
    }, {
        type: 'heatmap',
        coordinateSystem: 'calendar',
        calendarIndex: 2,
        data: getVirtulData(2015)
    }]
}

Other comments [其他信息]

The error can easily be reproduced at the demo page https://ecomfe.github.io/echarts-examples/public/editor.html?c=calendar-horizontal as long as timezone setting is set to UTC -3 or below. Error disappear when changing the timezone to European or Asian ones

NORMAL BEHAVIOR
image
image

BUGGING BEHAVIOR:
image
image

@100pah
Copy link
Member

100pah commented Aug 30, 2017

I am being puzzled with this issue:

When I set system timezone as "Time Zone: America/Toronto",
those code will get different result:

new Date(1478411999999).getTimezoneOffset();  // get 240
new Date(1478412000000).getTimezoneOffset();  // get 300

Do you know any hint about this issue?

@brunolajoie
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants