1

我正在使用带有 Angular Nvd3 指令的“Multichart”,并且我不断收到此错误消息:

错误:属性 transform="translate(0,NaN)" 的值无效

我不知道为什么会这样。

我的 HTML 代码如下所示:

<nvd3 options="options" data="data"></nvd3>

我的 JavaScript 看起来像这样:

  $scope.options = {
             chart: {
                 type: 'multiChart',
                 height: 450,
                 margin : {
                     top: 30,
                     right: 60,
                     bottom: 50,
                     left: 70
                 },
                 color: d3.scale.category10().range(),
                 //useInteractiveGuideline: true,
                 transitionDuration: 500,
                 xAxis: {
                     tickFormat: function(d){
                         return d3.format(',f')(d);
                     }
                 },
                 yAxis1: {
                     tickFormat: function(d){
                         return d3.format(',.1f')(d);
                     }
                 },
                 yAxis2: {
                     tickFormat: function(d){
                         return d3.format(',.1f')(d);
                     }
                 }
             }
         };

         $scope.data = [
           {
             key: "Stream0",
             originalKey: "Stream0",
             type: "area",
             yAxis: 1,
             seriesIndex: 0,
             values: [
               {
                 x:0,
                 y:1000,
                 index: 0,
                 seriesIndex: 0,
                 series: 0
               },
               {
                 x:1,
                 y:300,
                 index: 1,
                 seriesIndex: 0,
                 series: 0
               },
               {
                 x:2,
                 y:4000,
                 index: 2,
                 seriesIndex: 0,
                 series: 0
               },
               {
                 x:3,
                 y:5000,
                 index: 3,
                 seriesIndex: 0,
                 series: 0
               }
             ]
           }
         ];

请帮我解决这个问题,任何建议将不胜感激。

4

0 回答 0