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]?

Blix
  • 289
  • 2
  • 17

1 Answers1

0

Please try using this chart library. The examples in them for bar chart will be really helpful

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

Thanigainathan
  • 1,505
  • 14
  • 25
  • I am using the library you mentioned. In fact the Stackedbar chart is not a part of the page you pointing out. But it is a part of the Github repository. (Just letting you know in case you didn't really study this library enough.) You answer is not relevant to my question. – Blix Dec 08 '15 at 07:54
  • Can you please share the code on how you access the chart library from Angular service ? – Thanigainathan Dec 08 '15 at 17:39