nvd3 时间序列图未绘制

nvd3 Time Series Graph not getting plotted

我正在尝试获取基本的 NVD3 图,这是代码片段。

$scope.options = {
    chart: {
      type: 'stackedAreaChart',
      height: 450,
      margin : {
        top: 20,
        right: 20,
        bottom: 30,
        left: 40
      },
      x: function(d){ return Date(d[1]);},
      y: function(d){return d[0];},
      useVoronoi: false,
      clipEdge: true,
      duration: 0,
      useInteractiveGuideline: true,
      xScale: d3.time.scale(),
      xAxis: {
        showMaxMin: false,
        tickFormat: function(d) {
            return d3.time.format('%x')(new Date(d));
        }
      },
      yAxis: {
        tickFormat: function(d){
          return d;
        }
      }
    }
  };

提供给图表的数据是这样的:

$scope.data = [
    {
      "key" : "mac1" ,
      "values" : [ [ 5000 , "2016-02-03T11:07:58.940Z"] , [ 5200 , "2016-02-03T11:08:09.862Z"] ]
    }
  ];

图表中没有线条或堆叠区域。

X 轴是时间序列,日期为 1/1/1970。

我不确定我哪里出错了。请帮忙?

一些类似的 Whosebug 问题没有帮助是 -

nvd3 date formatting

我犯的错误是这样的,x: function(d){ return Date(d[1]);} 这一行将 return 日期格式,我在 tickFormat 中再次重新格式化日期。

更改为 x: function(d){ return d[1];} 有助于图表出现在屏幕上。

我也尝试修改 duration: 100 但无法从服务器刷新图表。有什么帮助吗?