2016-12-05 19 views
0

我正在使用Dygraph庫。yValue不在圖表中使用dygraphs庫

Dygraph

見圖片,爲什麼 「$ 0.00」 是出了圖表?
這裏是我的代碼:

new Dygraph(document.getElementById("graphdiv"), 
      $scope.dataPrediction, 
      { 
       errorBars: true, 
       animatedZooms: false, 
       customBars: true, 
       legend: 'always', 
       labelsSeparateLines: true, 
       axisLabelFontSize: '12', 
       labels: ["x", "Current costs", "Predicted cost by switching to reserved instance"], 
       labelsDivWidth: "440", 
       colors: ["#1f77b4", "#ff9f4a"], 
       axes: { 
        y: { 
         axisLabelFormatter: function (y) { 
          return "$" + y.toFixed(2); 
         }, 
         valueFormatter: function (y) { 
          return "$" + y.toFixed(2); 
         } 
        } 
       } 
      }); 

回答

0

我認爲這是Dygraph優化基於它的數據視圖。

有一個選項includeZero應該解決這個問題