Highcharts 认为所有日期都是 1970-01-01,尽管它们是有效的纪元时间

Highcharts thinks all dates are 1970-01-01, despite them being valid epoch times

我正在使用这个简单的图表:

https://jsfiddle.net/w7uyghqn/2/

我的日期格式为:Date(1447793679000),可正确转换为 Thu Aug 11 2016 10:26:59 GMT-0400 (EDT)

var seriesOptions = [
    {
        "data":[
            [Date(1447793679000), 7.8494623656],
            [Date(1450913358000), 5.4140127389],
            [Date(1460475392000), 6.015037594],
            [Date(1460648544000), 3.75],
            [Date(1460753244000), 2.1015761821],
            [Date(1460985174000), 3.0141843972],
            [Date(1460988174000), 5.2264808362],
            [Date(1461874589000), 1.5100671141]
        ],
        "name":"Product 1"
    },
    {
        "data":[
            [Date(1450729647000), 2.9850746269],
            [Date(1452184898000), 4.1666666667],
            [Date(1454616863000), 4.1749502982],
            [Date(1455206741000), 2.6717557252],
            [Date(1458062356000), 2.4],
            [Date(1459868909000), 3.8461538462],
            [Date(1459882015000), 3.3955857385],
            [Date(1459968893000), 4.1832669323],
            [Date(1460574864000), 4.973357016],
            [Date(1460665314000), 5.2032520325]
        ],
        "name":"Product 2"
    }
]

但是,正如您在 x 轴上看到的那样,这都是 1970 年 1 月 1 日。有人能发现哪里不对吗?

我已经尝试了很多种不同的格式,但我已经筋疲力尽了。

正如 jlbriggs 在评论中所说,您可以简单地删除 Date() 函数并使用实际数字,该数字将被 HighCharts 自动解释为自 1970 年 1 月 1 日以来的毫秒数,因为您告诉它xAxis.typedatetime.

我修改了你的 JSFiddle 并修复了问题,所以你可以看到它:Working JSFiddle

var seriesOptions = [
    {
        "data":[
            [1447793679000, 7.8494623656],
            [1450913358000, 5.4140127389],
            [1460475392000, 6.015037594],
            [1460648544000, 3.75],
            [1460753244000, 2.1015761821],
            [1460985174000, 3.0141843972],
            [1460988174000, 5.2264808362],
            [1461874589000, 1.5100671141]
        ],
        "name":"Product 1"
    },{
        "data":[
            [1450729647000, 2.9850746269],
            [1452184898000, 4.1666666667],
            [1454616863000, 4.1749502982],
            [1455206741000, 2.6717557252],
            [1458062356000, 2.4],
            [1459868909000, 3.8461538462],
            [1459882015000, 3.3955857385],
            [1459968893000, 4.1832669323],
            [1460574864000, 4.973357016],
            [1460665314000, 5.2032520325]
        ],
        "name":"Product 2"
    }
]