2016-12-05 13 views
0

Dygraph 라이브러리를 사용하고 있습니다.yValue는 dygraphs 라이브러리를 사용하여 차트에서 벗어났습니다.

Dygraph

참조 사진, 왜 "$ 0.00"차트를 벗어? 나는 그 Dygraph이가 가지고있는 데이터를 기반으로 뷰를 최적화하는 생각

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

:
다음은 내 코드입니다.

이 문제를 해결할 수있는 includeZero 옵션이 있습니다.