1

I am trying to push some data into Angular Stacked Bar chart array. Anyone who could advice me with this?

I have a function

myService.getWorkload().then(function(res) {
  json = res.data;
});

Then I have a Stacked Bar chart:

$scope.chart = {
    "series": []
    "data": [[],[]],
    }

And JSON:

[ { "label1": 2, "label2": 3, "label3": 4, "label4": 5 }, { "label1": 0, "label2": 2, "laber3": 4, "label4": 6 } ]

How do I get the JSON key and the value into the series[key] and data[value]?

4

1 に答える 1

0

このチャート ライブラリを使用してみてください。棒グラフの例は本当に役に立ちます

http://jtblin.github.io/angular-chart.js/

于 2015-12-07T23:15:57.450 に答える