Home Forums Report Bugs When summer time ends Charts axis labelFormatter “skips” an entire hour

When summer time ends Charts axis labelFormatter “skips” an entire hour

Viewing 2 posts - 1 through 2 (of 2 total)
  • #35949

    Hi team,

    We are using Charts for a customer in their web application. As both the customer and us are placed in Spain we will be switching from summer time to standard time on October 31, 3:00 AM, when it will be again 2:00 AM. Changing from DST to non-DST times seems to be causing trouble to how Charts represents time in an axis. Let’s see an example:

    DST to winter time example

    As we can see here, axisX has introduced a gap the size of an hour (let’s ignore the fact that there should be an additional mark after “2:30:00”). You can run this example live here but be aware that it may show different results if your locale does not observe DST or observes DST in a different day or time. Therefore, this example is best run in CEST regions.

    Here’s another example from our customer’s live environment:

    Live example showing DST to standard time issues

    This one is a bit different. Here we are processing labelFormatter to show times in UTC instead of local time. As you can see, the markers are missing from 1:00 AM to 2:00 AM UTC, which would correspond to 2-3 AM, Madrid time. On the other hand, the data is plotted correctly, and the hovered timestamp is shown in the last column of the green box as it should be.

    I have a clue that this issue might be related to a conversion between local times and an internal representation in UTC times. In the European Union we have to delay time one hour on the last Sunday of October, so we have 2:00-2:59 AM twice. The problem is, of course, that a local time like “2021-10-31 02:30:00” would have two representations in UTC, because UTC does not observe DST. I don’t know how Charts works internally but the fact that the axis “skips” an hour might be just a proportional way to represent the actual times it is able to “compute”.

    I don’t think there’s anything I can do about the first example, but as we are using UTC in the second one I have tried everything to force Charts to draw the “missing” labels, from 1 AM to 2 AM, to no avail. If I could find a way to draw them it would be fine and the customer would be happy.

    Is there anything I could do to overcome this issue, at least in our live example, or is this an actual bug with more serious implications in terms of how Charts works internally?

    Thank you very much for your help, best regards.
    Juan

    #35991

    Juan,

    We are looking into your query and will get back to you at the earliest.

    ___________
    Indranil Deo
    Team CanvasJS

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.