Home Forums Chart Support winter summer time transition

winter summer time transition

Viewing 3 posts - 1 through 3 (of 3 total)
  • #45855

    Different behaviour of the x-axis when switching from winter to summer time on 3/31/2024

    serialized data
    [{“x”:1711843200000.0,”y”:465.0},{“x”:1711846800000.0,”y”:467.0},{“x”:1711850400000.0,”y”:0.0},{“x”:1711854000000.0,”y”:463.0}]

    interpretation table
    31.3.2024 00-01 465.0 //sum of first hour
    31.3.2024 01-02 467.0 //sum of second hour
    31.3.2024 02-03 NAN or 0.0 //can be missed, but zero is fine too
    31.3.2024 03-04 463.0 //sum of third hour

    the canvas chart shows
    31.3.2024 01:00 465.0
    31.3.2024 03:00 467.0 // problematic move from 2. to 3. hour, but change logic of table
    31.3.2024 04:00 NAN 0.0
    31.3.2024 05:00 463.0

    #45858

    example in fiddle here :
    https://jsfiddle.net/v15bah4o/

    #45869

    Marcel,

    You can use the toUTCString() method to convert Javascript timestamp values into UTC format. Please refer to this stack overflow thread for more information.

    Also, you can use the toLocaleString() method in labelFormatter and tooltip contentFormatter to format date-time values displayed in the axis labels and tooltip. You can output dates that are in UTC or local time to a specific timezone by passing timeZone option to toLocaleString().


    Thangaraj Raman
    Team CanvasJS

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

You must be logged in to reply to this topic.