I have a $http call with which I retrieve an array of objects. I make three calls to this endpoint and end up with three arrays like the following:
[
{type: Dog, count: 3}
{type: Cat, count: 4}
{type: Elephant, count: 1}
]
[
{type: Dog, count: 1}
{type: Cat, count: 9}
]
[
{type: Dog, count: 19}
{type: Cat, count: 4}
{type: Elephant, count: 12}
{type: Frog, count: 2}
]
The first call is for August stats, the second September, the third October.
What I would like is to then create a dataset that looks like this...
[
{type:Dog, data:[3,1,9]}
{type:Cat, data:[4,9,4]}
{type:Elephant, data:[1. null, 12]}
{type:Frog, data:[null, null, 2}
]
... so that I can loop through each element with an ngRepeat to display a table of Months/Animals stats.
Anyone have any ideas?
Thanks.