2017-01-26 8 views
0

私持っている私は、私はその後、Googleのチャートについては、以下のセットアップ持って$ scope.oGoogleのチャート角度データは、カスタムCOLSと表示されない

[{"id":"[email protected]","label":"[email protected]","type":"number","p":{}},{"id":"[email protected]","label":"[email protected]","type":"number","p":{}},{"id":"[email protected]","label":"[email protected]","type":"number","p":{}},{"id":"[email protected]","label":"[email protected]","type":"number","p":{}},{"id":"[email protected]","label":"[email protected]","type":"number"}] 

で保存したJavaScriptオブジェクトの以下の配列:

$scope.data= { 
    "type": "LineChart", 
    "displayed": true, 
    "data": { 
    "cols":$scope.o, 
    "rows": [ 
     { 
     "c": [ 
      { 
      "v": "January" 
      }, 
      { 
      "v": 19, 
      "f": "42 items" 
      }, 
      { 
      "v": 12, 
      "f": "Ony 12 items" 
      }, 
      { 
      "v": 7, 
      "f": "7 servers" 
      }, 
      { 
      "v": 4 
      }, 
      {"v": 5} 
     ] 
     }, 
     { 
     "c": [ 
      { 
      "v": "February" 
      }, 
      { 
      "v": 13 
      }, 
      { 
      "v": 1, 
      "f": "1 unit (Out of stock this month)" 
      }, 
      { 
      "v": 12 
      }, 
      { 
      "v": 2 
      }, 
      { 
      "v": 2 
      } 
     ] 
     }, 
     { 
     "c": [ 
      { 
      "v": "March" 
      }, 
      { 
      "v": 24 
      }, 
      { 
      "v": 5 
      }, 
      { 
      "v": 11 
      }, 
      { 
      "v": 6 
      }, 
      { 
      "v":12 
      } 
     ] 
     } 
    ] 
    }, 
    "options": { 
    "title": "some data", 
    "tooltip": {trigger: "selection"}, 
    "isStacked": "true", 
    "fill": 20, 
    "displayExactValues": true, 
    "chartArea": {width: "70%", height: "70%"}, 
    "vAxis": { 
     "title": "data", 
     "gridlines": { 
     "count": 10 
     } 
    }, 
    "hAxis": { 
     "title": "month" 
    } 
    }, 
    "formatters": {} 
} 




}]); 

ご覧のとおり、ここでサンプルアプリケーションに行ったことはすべて:http://angular-google-chart.github.io/angular-google-chart/docs/latest/examples/multi-chart/ カスタムのものに変更します。

このような仕組みでは、凡例が電子メールアドレスのラベルを引っ張りますが、グラフは空であり、データは表示されません。

なぜこのようなことが起こるかについてのご意見はありますか?それを修正

答えて

0

...私は追加する必要: $ scope.o.push({ ID: "月"、 ラベル: "月"、 タイプ: "文字列" }); forループの前に 。ルーキーミス!

関連する問題